diff --git a/src/dependency_injector/providers/callables.c b/src/dependency_injector/providers/callables.c index 4b10a4b1..409318b8 100644 --- a/src/dependency_injector/providers/callables.c +++ b/src/dependency_injector/providers/callables.c @@ -715,24 +715,11 @@ struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext { * * * cdef class Injection(object): # <<<<<<<<<<<<<< - * pass - * - */ -struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { - PyObject_HEAD -}; - - -/* "injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< * cdef object __value * cdef int __is_provider */ -struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { - struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtab; +struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { + PyObject_HEAD PyObject *__pyx___value; int __pyx___is_provider; int __pyx___is_delegated; @@ -740,21 +727,28 @@ struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjecti }; -/* "injections.pxd":25 +/* "injections.pxd":16 + * + * + * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; +}; + + +/* "injections.pxd":20 * * * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< * cdef object __name - * cdef object __value + * */ struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection { struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtab; PyObject *__pyx___name; - PyObject *__pyx___value; - int __pyx___is_provider; - int __pyx___is_delegated; - int __pyx___call; }; @@ -775,11 +769,12 @@ struct __pyx_obj_19dependency_injector_9providers_9callables_Callable { }; -/* "dependency_injector/providers/callables.pxd":41 +/* "dependency_injector/providers/callables.pxd":28 * * * cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable { struct __pyx_obj_19dependency_injector_9providers_9callables_Callable __pyx_base; @@ -844,39 +839,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependenc static struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency *__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency; -/* "injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< - * cdef object __value - * cdef int __is_provider - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection { - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); - - -/* "injections.pxd":25 - * - * - * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< - * cdef object __name - * cdef object __value - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection { - PyObject *(*__pyx___get_name)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - - -/* "dependency_injector/providers/callables.pyx":21 +/* "dependency_injector/providers/callables.pyx":22 * * * cdef class Callable(Provider): # <<<<<<<<<<<<<< @@ -886,13 +849,11 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable { struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable *__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); -/* "dependency_injector/providers/callables.pyx":202 +/* "dependency_injector/providers/callables.pyx":203 * * * cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<< @@ -1243,10 +1204,6 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable__provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ /* Module declarations from 'dependency_injector.providers.base' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_4base_Provider = 0; @@ -1261,6 +1218,8 @@ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_4base_Overridi static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_Injection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(PyObject *, PyObject *, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(PyObject *, PyObject *, int); /*proto*/ static PyObject *(*__pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections)(PyObject *, int __pyx_skip_dispatch); /*proto*/ @@ -1275,6 +1234,7 @@ static PyObject *(*__pyx_f_19dependency_injector_9providers_5utils_deepcopy)(PyO /* Module declarations from 'dependency_injector.providers.callables' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9callables_Callable = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables___call(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "dependency_injector.providers.callables" int __pyx_module_is_main_dependency_injector__providers__callables = 0; @@ -1353,7 +1313,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ static PyObject *__pyx_tp_new_19dependency_injector_9providers_9callables_Callable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_19dependency_injector_9providers_9callables_DelegatedCallable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -/* "dependency_injector/providers/callables.pyx":45 +/* "dependency_injector/providers/callables.pyx":46 * """ * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -1406,7 +1366,7 @@ static int __pyx_pw_19dependency_injector_9providers_9callables_8Callable_1__ini } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 46, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -1417,7 +1377,7 @@ static int __pyx_pw_19dependency_injector_9providers_9callables_8Callable_1__ini } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -1449,63 +1409,63 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init int __pyx_t_10; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/callables.pyx":57 + /* "dependency_injector/providers/callables.pyx":58 * :type kwargs: dict[str, object] * """ * if not callable(provides): # <<<<<<<<<<<<<< * raise Error('Provider {0} expected to get callable, ' * 'got {0}'.format('.'.join((self.__class__.__module__, */ - __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_provides); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_provides); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "dependency_injector/providers/callables.pyx":58 + /* "dependency_injector/providers/callables.pyx":59 * """ * if not callable(provides): * raise Error('Provider {0} expected to get callable, ' # <<<<<<<<<<<<<< * 'got {0}'.format('.'.join((self.__class__.__module__, * self.__class__.__name__)), */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "dependency_injector/providers/callables.pyx":59 + /* "dependency_injector/providers/callables.pyx":60 * if not callable(provides): * raise Error('Provider {0} expected to get callable, ' * 'got {0}'.format('.'.join((self.__class__.__module__, # <<<<<<<<<<<<<< * self.__class__.__name__)), * provides)) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provider_0_expected_to_get_calla, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provider_0_expected_to_get_calla, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_module); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_module); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/providers/callables.pyx":60 + /* "dependency_injector/providers/callables.pyx":61 * raise Error('Provider {0} expected to get callable, ' * 'got {0}'.format('.'.join((self.__class__.__module__, * self.__class__.__name__)), # <<<<<<<<<<<<<< * provides)) * self.__provides = provides */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/providers/callables.pyx":59 + /* "dependency_injector/providers/callables.pyx":60 * if not callable(provides): * raise Error('Provider {0} expected to get callable, ' * 'got {0}'.format('.'.join((self.__class__.__module__, # <<<<<<<<<<<<<< * self.__class__.__name__)), * provides)) */ - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); @@ -1513,11 +1473,11 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/providers/callables.pyx":61 + /* "dependency_injector/providers/callables.pyx":62 * 'got {0}'.format('.'.join((self.__class__.__module__, * self.__class__.__name__)), * provides)) # <<<<<<<<<<<<<< @@ -1539,7 +1499,7 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_v_provides}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -1548,14 +1508,14 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_v_provides}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -1566,7 +1526,7 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init __Pyx_GIVEREF(__pyx_v_provides); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_provides); __pyx_t_9 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -1582,14 +1542,14 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init } } if (!__pyx_t_6) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -1598,20 +1558,20 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -1619,9 +1579,9 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 58, __pyx_L1_error) + __PYX_ERR(0, 59, __pyx_L1_error) - /* "dependency_injector/providers/callables.pyx":57 + /* "dependency_injector/providers/callables.pyx":58 * :type kwargs: dict[str, object] * """ * if not callable(provides): # <<<<<<<<<<<<<< @@ -1630,7 +1590,7 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init */ } - /* "dependency_injector/providers/callables.pyx":62 + /* "dependency_injector/providers/callables.pyx":63 * self.__class__.__name__)), * provides)) * self.__provides = provides # <<<<<<<<<<<<<< @@ -1643,14 +1603,14 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init __Pyx_DECREF(__pyx_v_self->__pyx___provides); __pyx_v_self->__pyx___provides = __pyx_v_provides; - /* "dependency_injector/providers/callables.pyx":64 + /* "dependency_injector/providers/callables.pyx":65 * self.__provides = provides * * self.__args = tuple() # <<<<<<<<<<<<<< * self.__args_len = 0 * self.set_args(*args) */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx___args); @@ -1658,7 +1618,7 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init __pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/callables.pyx":65 + /* "dependency_injector/providers/callables.pyx":66 * * self.__args = tuple() * self.__args_len = 0 # <<<<<<<<<<<<<< @@ -1667,28 +1627,28 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init */ __pyx_v_self->__pyx___args_len = 0; - /* "dependency_injector/providers/callables.pyx":66 + /* "dependency_injector/providers/callables.pyx":67 * self.__args = tuple() * self.__args_len = 0 * self.set_args(*args) # <<<<<<<<<<<<<< * * self.__kwargs = tuple() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_args, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_args, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/providers/callables.pyx":68 + /* "dependency_injector/providers/callables.pyx":69 * self.set_args(*args) * * self.__kwargs = tuple() # <<<<<<<<<<<<<< * self.__kwargs_len = 0 * self.set_kwargs(**kwargs) */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx___kwargs); @@ -1696,7 +1656,7 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init __pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/providers/callables.pyx":69 + /* "dependency_injector/providers/callables.pyx":70 * * self.__kwargs = tuple() * self.__kwargs_len = 0 # <<<<<<<<<<<<<< @@ -1705,28 +1665,28 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init */ __pyx_v_self->__pyx___kwargs_len = 0; - /* "dependency_injector/providers/callables.pyx":70 + /* "dependency_injector/providers/callables.pyx":71 * self.__kwargs = tuple() * self.__kwargs_len = 0 * self.set_kwargs(**kwargs) # <<<<<<<<<<<<<< * * super(Callable, self).__init__() */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __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; - /* "dependency_injector/providers/callables.pyx":72 + /* "dependency_injector/providers/callables.pyx":73 * self.set_kwargs(**kwargs) * * super(Callable, self).__init__() # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9callables_Callable)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9callables_Callable)); @@ -1734,10 +1694,10 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -1751,16 +1711,16 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init } } if (__pyx_t_8) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __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; - /* "dependency_injector/providers/callables.pyx":45 + /* "dependency_injector/providers/callables.pyx":46 * """ * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -1786,7 +1746,7 @@ static int __pyx_pf_19dependency_injector_9providers_9callables_8Callable___init return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":74 +/* "dependency_injector/providers/callables.pyx":75 * super(Callable, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -1826,21 +1786,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__deepcopy__", 0); - /* "dependency_injector/providers/callables.pyx":76 + /* "dependency_injector/providers/callables.pyx":77 * def __deepcopy__(self, memo): * """Create and return full copy of provider.""" * copied = memo.get(id(self)) # <<<<<<<<<<<<<< * if copied is not None: * return copied */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -1854,14 +1814,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1870,20 +1830,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -1892,7 +1852,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_copied = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":77 + /* "dependency_injector/providers/callables.pyx":78 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1903,7 +1863,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "dependency_injector/providers/callables.pyx":78 + /* "dependency_injector/providers/callables.pyx":79 * copied = memo.get(id(self)) * if copied is not None: * return copied # <<<<<<<<<<<<<< @@ -1915,7 +1875,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":77 + /* "dependency_injector/providers/callables.pyx":78 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1924,91 +1884,91 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ */ } - /* "dependency_injector/providers/callables.pyx":80 + /* "dependency_injector/providers/callables.pyx":81 * return copied * * copied = self.__class__(self.provides, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pyx":81 + /* "dependency_injector/providers/callables.pyx":82 * * copied = self.__class__(self.provides, * *deepcopy(self.args, memo), # <<<<<<<<<<<<<< * **deepcopy(self.kwargs, memo)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 81, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pyx":80 + /* "dependency_injector/providers/callables.pyx":81 * return copied * * copied = self.__class__(self.provides, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pyx":82 + /* "dependency_injector/providers/callables.pyx":83 * copied = self.__class__(self.provides, * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) # <<<<<<<<<<<<<< * * for overriding_provider in self.overridden: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 82, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 83, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 82, __pyx_L1_error) + __PYX_ERR(0, 83, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_3))) { - __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "dependency_injector/providers/callables.pyx":80 + /* "dependency_injector/providers/callables.pyx":81 * return copied * * copied = self.__class__(self.provides, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2016,22 +1976,22 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/callables.pyx":84 + /* "dependency_injector/providers/callables.pyx":85 * **deepcopy(self.kwargs, memo)) * * for overriding_provider in self.overridden: # <<<<<<<<<<<<<< * copied.override(deepcopy(overriding_provider, memo)) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __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); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 85, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -2039,17 +1999,17 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -2059,7 +2019,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 84, __pyx_L1_error) + else __PYX_ERR(0, 85, __pyx_L1_error) } break; } @@ -2068,19 +2028,19 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/callables.pyx":85 + /* "dependency_injector/providers/callables.pyx":86 * * for overriding_provider in self.overridden: * copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<< * * return copied */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 85, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -2093,14 +2053,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ } } if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2109,20 +2069,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -2130,7 +2090,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/callables.pyx":84 + /* "dependency_injector/providers/callables.pyx":85 * **deepcopy(self.kwargs, memo)) * * for overriding_provider in self.overridden: # <<<<<<<<<<<<<< @@ -2140,7 +2100,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pyx":87 + /* "dependency_injector/providers/callables.pyx":88 * copied.override(deepcopy(overriding_provider, memo)) * * return copied # <<<<<<<<<<<<<< @@ -2152,7 +2112,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":74 + /* "dependency_injector/providers/callables.pyx":75 * super(Callable, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -2178,7 +2138,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":89 +/* "dependency_injector/providers/callables.pyx":90 * return copied * * def __str__(self): # <<<<<<<<<<<<<< @@ -2210,7 +2170,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__str__", 0); - /* "dependency_injector/providers/callables.pyx":94 + /* "dependency_injector/providers/callables.pyx":95 * :rtype: str * """ * return represent_provider(provider=self, provides=self.__provides) # <<<<<<<<<<<<<< @@ -2220,14 +2180,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->__pyx___provides; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_5utils_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_5utils_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":89 + /* "dependency_injector/providers/callables.pyx":90 * return copied * * def __str__(self): # <<<<<<<<<<<<<< @@ -2247,7 +2207,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":97 +/* "dependency_injector/providers/callables.pyx":98 * * @property * def provides(self): # <<<<<<<<<<<<<< @@ -2273,7 +2233,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/callables.pyx":99 + /* "dependency_injector/providers/callables.pyx":100 * def provides(self): * """Return wrapped callable.""" * return self.__provides # <<<<<<<<<<<<<< @@ -2285,7 +2245,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = __pyx_v_self->__pyx___provides; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":97 + /* "dependency_injector/providers/callables.pyx":98 * * @property * def provides(self): # <<<<<<<<<<<<<< @@ -2300,7 +2260,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":102 +/* "dependency_injector/providers/callables.pyx":103 * * @property * def args(self): # <<<<<<<<<<<<<< @@ -2333,19 +2293,19 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ int __pyx_t_4; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/callables.pyx":108 + /* "dependency_injector/providers/callables.pyx":109 * cdef list args * * args = list() # <<<<<<<<<<<<<< * for index in range(self.__args_len): * arg = self.__args[index] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":109 + /* "dependency_injector/providers/callables.pyx":110 * * args = list() * for index in range(self.__args_len): # <<<<<<<<<<<<<< @@ -2356,7 +2316,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_index = __pyx_t_3; - /* "dependency_injector/providers/callables.pyx":110 + /* "dependency_injector/providers/callables.pyx":111 * args = list() * for index in range(self.__args_len): * arg = self.__args[index] # <<<<<<<<<<<<<< @@ -2365,28 +2325,28 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ */ if (unlikely(__pyx_v_self->__pyx___args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 110, __pyx_L1_error) + __PYX_ERR(0, 111, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection))))) __PYX_ERR(0, 110, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection))))) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_arg, ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)__pyx_t_1)); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":111 + /* "dependency_injector/providers/callables.pyx":112 * for index in range(self.__args_len): * arg = self.__args[index] * args.append(arg.__value) # <<<<<<<<<<<<<< * return tuple(args) * */ - __pyx_t_1 = __pyx_v_arg->__pyx___value; + __pyx_t_1 = __pyx_v_arg->__pyx_base.__pyx___value; __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/callables.pyx":112 + /* "dependency_injector/providers/callables.pyx":113 * arg = self.__args[index] * args.append(arg.__value) * return tuple(args) # <<<<<<<<<<<<<< @@ -2394,13 +2354,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ * def add_args(self, *args): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_AsTuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = PyList_AsTuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":102 + /* "dependency_injector/providers/callables.pyx":103 * * @property * def args(self): # <<<<<<<<<<<<<< @@ -2421,7 +2381,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":114 +/* "dependency_injector/providers/callables.pyx":115 * return tuple(args) * * def add_args(self, *args): # <<<<<<<<<<<<<< @@ -2456,16 +2416,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ Py_ssize_t __pyx_t_3; __Pyx_RefNannySetupContext("add_args", 0); - /* "dependency_injector/providers/callables.pyx":122 + /* "dependency_injector/providers/callables.pyx":123 * :return: Reference ``self`` * """ * self.__args += parse_positional_injections(args) # <<<<<<<<<<<<<< * self.__args_len = len(self.__args) * return self */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___args, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___args, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); @@ -2474,7 +2434,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pyx":123 + /* "dependency_injector/providers/callables.pyx":124 * """ * self.__args += parse_positional_injections(args) * self.__args_len = len(self.__args) # <<<<<<<<<<<<<< @@ -2485,13 +2445,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 123, __pyx_L1_error) + __PYX_ERR(0, 124, __pyx_L1_error) } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->__pyx___args_len = __pyx_t_3; - /* "dependency_injector/providers/callables.pyx":124 + /* "dependency_injector/providers/callables.pyx":125 * self.__args += parse_positional_injections(args) * self.__args_len = len(self.__args) * return self # <<<<<<<<<<<<<< @@ -2503,7 +2463,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":114 + /* "dependency_injector/providers/callables.pyx":115 * return tuple(args) * * def add_args(self, *args): # <<<<<<<<<<<<<< @@ -2523,7 +2483,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":126 +/* "dependency_injector/providers/callables.pyx":127 * return self * * def set_args(self, *args): # <<<<<<<<<<<<<< @@ -2557,14 +2517,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("set_args", 0); - /* "dependency_injector/providers/callables.pyx":136 + /* "dependency_injector/providers/callables.pyx":137 * :return: Reference ``self`` * """ * self.__args = parse_positional_injections(args) # <<<<<<<<<<<<<< * self.__args_len = len(self.__args) * return self */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___args); @@ -2572,7 +2532,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":137 + /* "dependency_injector/providers/callables.pyx":138 * """ * self.__args = parse_positional_injections(args) * self.__args_len = len(self.__args) # <<<<<<<<<<<<<< @@ -2583,13 +2543,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 137, __pyx_L1_error) + __PYX_ERR(0, 138, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx___args_len = __pyx_t_2; - /* "dependency_injector/providers/callables.pyx":138 + /* "dependency_injector/providers/callables.pyx":139 * self.__args = parse_positional_injections(args) * self.__args_len = len(self.__args) * return self # <<<<<<<<<<<<<< @@ -2601,7 +2561,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":126 + /* "dependency_injector/providers/callables.pyx":127 * return self * * def set_args(self, *args): # <<<<<<<<<<<<<< @@ -2620,7 +2580,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":140 +/* "dependency_injector/providers/callables.pyx":141 * return self * * def clear_args(self): # <<<<<<<<<<<<<< @@ -2649,14 +2609,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("clear_args", 0); - /* "dependency_injector/providers/callables.pyx":145 + /* "dependency_injector/providers/callables.pyx":146 * :return: Reference ``self`` * """ * self.__args = tuple() # <<<<<<<<<<<<<< * self.__args_len = len(self.__args) * return self */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___args); @@ -2664,7 +2624,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":146 + /* "dependency_injector/providers/callables.pyx":147 * """ * self.__args = tuple() * self.__args_len = len(self.__args) # <<<<<<<<<<<<<< @@ -2675,13 +2635,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 146, __pyx_L1_error) + __PYX_ERR(0, 147, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx___args_len = __pyx_t_2; - /* "dependency_injector/providers/callables.pyx":147 + /* "dependency_injector/providers/callables.pyx":148 * self.__args = tuple() * self.__args_len = len(self.__args) * return self # <<<<<<<<<<<<<< @@ -2693,7 +2653,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":140 + /* "dependency_injector/providers/callables.pyx":141 * return self * * def clear_args(self): # <<<<<<<<<<<<<< @@ -2712,7 +2672,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":150 +/* "dependency_injector/providers/callables.pyx":151 * * @property * def kwargs(self): # <<<<<<<<<<<<<< @@ -2744,19 +2704,19 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ int __pyx_t_3; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/callables.pyx":156 + /* "dependency_injector/providers/callables.pyx":157 * cdef dict kwargs * * kwargs = dict() # <<<<<<<<<<<<<< * for index in range(self.__kwargs_len): * kwarg = self.__kwargs[index] */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_kwargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":157 + /* "dependency_injector/providers/callables.pyx":158 * * kwargs = dict() * for index in range(self.__kwargs_len): # <<<<<<<<<<<<<< @@ -2767,7 +2727,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_index = __pyx_t_3; - /* "dependency_injector/providers/callables.pyx":158 + /* "dependency_injector/providers/callables.pyx":159 * kwargs = dict() * for index in range(self.__kwargs_len): * kwarg = self.__kwargs[index] # <<<<<<<<<<<<<< @@ -2776,28 +2736,28 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ */ if (unlikely(__pyx_v_self->__pyx___kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 158, __pyx_L1_error) + __PYX_ERR(0, 159, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___kwargs, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___kwargs, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection))))) __PYX_ERR(0, 158, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection))))) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_kwarg, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_1)); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":159 + /* "dependency_injector/providers/callables.pyx":160 * for index in range(self.__kwargs_len): * kwarg = self.__kwargs[index] * kwargs[kwarg.__name] = kwarg.__value # <<<<<<<<<<<<<< * return kwargs * */ - __pyx_t_1 = __pyx_v_kwarg->__pyx___value; + __pyx_t_1 = __pyx_v_kwarg->__pyx_base.__pyx___value; __Pyx_INCREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_kwarg->__pyx___name, __pyx_t_1) < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_kwarg->__pyx___name, __pyx_t_1) < 0)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/callables.pyx":160 + /* "dependency_injector/providers/callables.pyx":161 * kwarg = self.__kwargs[index] * kwargs[kwarg.__name] = kwarg.__value * return kwargs # <<<<<<<<<<<<<< @@ -2809,7 +2769,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = __pyx_v_kwargs; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":150 + /* "dependency_injector/providers/callables.pyx":151 * * @property * def kwargs(self): # <<<<<<<<<<<<<< @@ -2830,7 +2790,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":162 +/* "dependency_injector/providers/callables.pyx":163 * return kwargs * * def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2867,16 +2827,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ Py_ssize_t __pyx_t_3; __Pyx_RefNannySetupContext("add_kwargs", 0); - /* "dependency_injector/providers/callables.pyx":170 + /* "dependency_injector/providers/callables.pyx":171 * :return: Reference ``self`` * """ * self.__kwargs += parse_named_injections(kwargs) # <<<<<<<<<<<<<< * self.__kwargs_len = len(self.__kwargs) * return self */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___kwargs, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___kwargs, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); @@ -2885,7 +2845,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pyx":171 + /* "dependency_injector/providers/callables.pyx":172 * """ * self.__kwargs += parse_named_injections(kwargs) * self.__kwargs_len = len(self.__kwargs) # <<<<<<<<<<<<<< @@ -2896,13 +2856,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 171, __pyx_L1_error) + __PYX_ERR(0, 172, __pyx_L1_error) } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->__pyx___kwargs_len = __pyx_t_3; - /* "dependency_injector/providers/callables.pyx":172 + /* "dependency_injector/providers/callables.pyx":173 * self.__kwargs += parse_named_injections(kwargs) * self.__kwargs_len = len(self.__kwargs) * return self # <<<<<<<<<<<<<< @@ -2914,7 +2874,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":162 + /* "dependency_injector/providers/callables.pyx":163 * return kwargs * * def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2934,7 +2894,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":174 +/* "dependency_injector/providers/callables.pyx":175 * return self * * def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2970,14 +2930,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("set_kwargs", 0); - /* "dependency_injector/providers/callables.pyx":184 + /* "dependency_injector/providers/callables.pyx":185 * :return: Reference ``self`` * """ * self.__kwargs = parse_named_injections(kwargs) # <<<<<<<<<<<<<< * self.__kwargs_len = len(self.__kwargs) * return self */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___kwargs); @@ -2985,7 +2945,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":185 + /* "dependency_injector/providers/callables.pyx":186 * """ * self.__kwargs = parse_named_injections(kwargs) * self.__kwargs_len = len(self.__kwargs) # <<<<<<<<<<<<<< @@ -2996,13 +2956,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 185, __pyx_L1_error) + __PYX_ERR(0, 186, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx___kwargs_len = __pyx_t_2; - /* "dependency_injector/providers/callables.pyx":186 + /* "dependency_injector/providers/callables.pyx":187 * self.__kwargs = parse_named_injections(kwargs) * self.__kwargs_len = len(self.__kwargs) * return self # <<<<<<<<<<<<<< @@ -3014,7 +2974,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":174 + /* "dependency_injector/providers/callables.pyx":175 * return self * * def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -3033,7 +2993,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":188 +/* "dependency_injector/providers/callables.pyx":189 * return self * * def clear_kwargs(self): # <<<<<<<<<<<<<< @@ -3062,14 +3022,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("clear_kwargs", 0); - /* "dependency_injector/providers/callables.pyx":193 + /* "dependency_injector/providers/callables.pyx":194 * :return: Reference ``self`` * """ * self.__kwargs = tuple() # <<<<<<<<<<<<<< * self.__kwargs_len = len(self.__kwargs) * return self */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___kwargs); @@ -3077,7 +3037,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pyx":194 + /* "dependency_injector/providers/callables.pyx":195 * """ * self.__kwargs = tuple() * self.__kwargs_len = len(self.__kwargs) # <<<<<<<<<<<<<< @@ -3088,13 +3048,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 194, __pyx_L1_error) + __PYX_ERR(0, 195, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx___kwargs_len = __pyx_t_2; - /* "dependency_injector/providers/callables.pyx":195 + /* "dependency_injector/providers/callables.pyx":196 * self.__kwargs = tuple() * self.__kwargs_len = len(self.__kwargs) * return self # <<<<<<<<<<<<<< @@ -3106,7 +3066,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":188 + /* "dependency_injector/providers/callables.pyx":189 * return self * * def clear_kwargs(self): # <<<<<<<<<<<<<< @@ -3125,12 +3085,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "dependency_injector/providers/callables.pyx":197 +/* "dependency_injector/providers/callables.pyx":198 * return self * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return result of provided callable's call.""" - * return self.__provide(args, kwargs) + * return __call(self, args, kwargs) */ static PyObject *__pyx_pw_19dependency_injector_9providers_9callables_8Callable_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -3148,7 +3108,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable__ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_9callables_8Callable_19_provide)) { __Pyx_XDECREF(__pyx_r); @@ -3168,7 +3128,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable__ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -3176,13 +3136,13 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable__ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -3193,7 +3153,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable__ __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -3206,26 +3166,26 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable__ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/callables.pyx":199 + /* "dependency_injector/providers/callables.pyx":200 * cpdef object _provide(self, tuple args, dict kwargs): * """Return result of provided callable's call.""" - * return self.__provide(args, kwargs) # <<<<<<<<<<<<<< + * return __call(self, args, kwargs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9callables___call(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/callables.pyx":197 + /* "dependency_injector/providers/callables.pyx":198 * return self * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return result of provided callable's call.""" - * return self.__provide(args, kwargs) + * return __call(self, args, kwargs) */ /* function exit code */ @@ -3272,11 +3232,11 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_9callables_8Callable_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 198, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 197, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 198, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3289,14 +3249,14 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_9callables_8Callable_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 198, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.callables.Callable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 197, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 197, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 198, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 198, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_9callables_8Callable_18_provide(((struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ @@ -3314,7 +3274,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_provide", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9callables_8Callable__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9callables_8Callable__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3331,136 +3291,36 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9callables_8Callable_ return __pyx_r; } -/* "injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__get_value", 0); - - /* "injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); - if (__pyx_t_1) { - - /* "injections.pxd":21 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_r = __pyx_v_self->__pyx___value; - goto __pyx_L0; - - /* "injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - } - - /* "injections.pxd":22 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< +/* "injections.pxd":24 * * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_t_3 = __pyx_v_self->__pyx___value; __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && 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); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.PositionalInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "injections.pxd":32 - * cdef int __call - * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get_name", 0); - /* "injections.pxd":33 + /* "injections.pxd":25 + * + * cdef inline object __get_name(NamedInjection self): + * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_name(self): - * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_value(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx___name); __pyx_r = __pyx_v_self->__pyx___name; goto __pyx_L0; - /* "injections.pxd":32 - * cdef int __call + /* "injections.pxd":24 * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ @@ -3471,15 +3331,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":35 - * return self.__name +/* "injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3488,21 +3348,21 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get_value", 0); - /* "injections.pxd":36 + /* "injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); if (__pyx_t_1) { - /* "injections.pxd":37 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() + /* "injections.pxd":30 + * cdef inline object __get_value(Injection self): + * if self.__call == 0: + * return self.__value # <<<<<<<<<<<<<< + * return self.__value() * */ __Pyx_XDECREF(__pyx_r); @@ -3510,19 +3370,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_self->__pyx___value; goto __pyx_L0; - /* "injections.pxd":36 + /* "injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ } - /* "injections.pxd":38 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< + /* "injections.pxd":31 + * if self.__call == 0: + * return self.__value + * return self.__value() # <<<<<<<<<<<<<< * * */ @@ -3539,10 +3399,10 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3550,12 +3410,12 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_2 = 0; goto __pyx_L0; - /* "injections.pxd":35 - * return self.__name + /* "injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ /* function exit code */ @@ -3563,7 +3423,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.NamedInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.injections.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3571,7 +3431,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":43 +/* "injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -3592,7 +3452,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__provide_positional_args", 0); - /* "injections.pxd":50 + /* "injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -3602,7 +3462,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0); if (__pyx_t_1) { - /* "injections.pxd":51 + /* "injections.pxd":44 * * if inj_args_len == 0: * return args # <<<<<<<<<<<<<< @@ -3614,7 +3474,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_args; goto __pyx_L0; - /* "injections.pxd":50 + /* "injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -3623,68 +3483,68 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ } - /* "injections.pxd":53 + /* "injections.pxd":46 * return args * * positional_args = list() # <<<<<<<<<<<<<< * for index in range(inj_args_len): * injection = inj_args[index] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "injections.pxd":54 + /* "injections.pxd":47 * * positional_args = list() * for index in range(inj_args_len): # <<<<<<<<<<<<<< * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) */ __pyx_t_3 = __pyx_v_inj_args_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":55 + /* "injections.pxd":48 * positional_args = list() * for index in range(inj_args_len): * injection = inj_args[index] # <<<<<<<<<<<<<< - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) */ if (unlikely(__pyx_v_inj_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 55, __pyx_L1_error) + __PYX_ERR(1, 48, __pyx_L1_error) } __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)__pyx_t_2)); __pyx_t_2 = 0; - /* "injections.pxd":56 + /* "injections.pxd":49 * for index in range(inj_args_len): * injection = inj_args[index] - * positional_args.append(injection.__get_value()) # <<<<<<<<<<<<<< + * positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<< * positional_args.extend(args) * */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(__pyx_v_injection); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 56, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "injections.pxd":57 + /* "injections.pxd":50 * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) # <<<<<<<<<<<<<< * * return tuple(positional_args) */ - __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 57, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 50, __pyx_L1_error) - /* "injections.pxd":59 + /* "injections.pxd":52 * positional_args.extend(args) * * return tuple(positional_args) # <<<<<<<<<<<<<< @@ -3692,13 +3552,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "injections.pxd":43 + /* "injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -3719,7 +3579,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":64 +/* "injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -3741,7 +3601,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_6; __Pyx_RefNannySetupContext("__provide_keyword_args", 0); - /* "injections.pxd":71 + /* "injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -3750,69 +3610,69 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 71, __pyx_L1_error) + __PYX_ERR(1, 64, __pyx_L1_error) } - __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 64, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "injections.pxd":72 + /* "injections.pxd":65 * * if len(kwargs) == 0: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":73 + /* "injections.pxd":66 * if len(kwargs) == 0: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 73, __pyx_L1_error) + __PYX_ERR(1, 66, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "injections.pxd":74 + /* "injections.pxd":67 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) * else: */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":75 + /* "injections.pxd":68 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * else: * for index in range(inj_kwargs_len): */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 75, __pyx_L1_error) + __PYX_ERR(1, 68, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 75, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - /* "injections.pxd":71 + /* "injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -3822,82 +3682,82 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject goto __pyx_L3; } - /* "injections.pxd":77 - * kwargs[name] = kw_injection.__get_value() + /* "injections.pxd":70 + * kwargs[name] = __get_value(kw_injection) * else: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ /*else*/ { __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":78 + /* "injections.pxd":71 * else: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 78, __pyx_L1_error) + __PYX_ERR(1, 71, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "injections.pxd":79 + /* "injections.pxd":72 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":80 + /* "injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 80, __pyx_L1_error) + __PYX_ERR(1, 73, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 80, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 73, __pyx_L1_error) __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { - /* "injections.pxd":81 - * name = kw_injection.__get_name() + /* "injections.pxd":74 + * name = __get_name(kw_injection) * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * * return kwargs */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 81, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 81, __pyx_L1_error) + __PYX_ERR(1, 74, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 81, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":80 + /* "injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ } @@ -3905,8 +3765,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } __pyx_L3:; - /* "injections.pxd":83 - * kwargs[name] = kw_injection.__get_value() + /* "injections.pxd":76 + * kwargs[name] = __get_value(kw_injection) * * return kwargs # <<<<<<<<<<<<<< * @@ -3917,7 +3777,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_kwargs; goto __pyx_L0; - /* "injections.pxd":64 + /* "injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -3938,7 +3798,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":88 +/* "injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -3958,7 +3818,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__inject_attributes", 0); - /* "injections.pxd":92 + /* "injections.pxd":85 * int attributes_len): * cdef NamedInjection attr_injection * for index in range(attributes_len): # <<<<<<<<<<<<<< @@ -3969,55 +3829,55 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_index = __pyx_t_2; - /* "injections.pxd":93 + /* "injections.pxd":86 * cdef NamedInjection attr_injection * for index in range(attributes_len): * attr_injection = attributes[index] # <<<<<<<<<<<<<< * setattr(instance, - * attr_injection.__get_name(), + * __get_name(attr_injection), */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 93, __pyx_L1_error) + __PYX_ERR(1, 86, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index); __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_3)); __pyx_t_3 = 0; - /* "injections.pxd":95 + /* "injections.pxd":88 * attr_injection = attributes[index] * setattr(instance, - * attr_injection.__get_name(), # <<<<<<<<<<<<<< - * attr_injection.__get_value()) + * __get_name(attr_injection), # <<<<<<<<<<<<<< + * __get_value(attr_injection)) * */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 95, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "injections.pxd":96 + /* "injections.pxd":89 * setattr(instance, - * attr_injection.__get_name(), - * attr_injection.__get_value()) # <<<<<<<<<<<<<< + * __get_name(attr_injection), + * __get_value(attr_injection)) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_attr_injection); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 96, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "injections.pxd":94 + /* "injections.pxd":87 * for index in range(attributes_len): * attr_injection = attributes[index] * setattr(instance, # <<<<<<<<<<<<<< - * attr_injection.__get_name(), - * attr_injection.__get_value()) + * __get_name(attr_injection), + * __get_value(attr_injection)) */ - __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "injections.pxd":88 + /* "injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -4040,104 +3900,102 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "dependency_injector/providers/callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) +/* "dependency_injector/providers/callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables___call(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_positional_args = 0; PyObject *__pyx_v_keyword_args = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); + __Pyx_RefNannySetupContext("__call", 0); - /* "dependency_injector/providers/callables.pxd":32 + /* "dependency_injector/providers/callables.pxd":37 * - * positional_args = __provide_positional_args(args, - * self.__args, # <<<<<<<<<<<<<< - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, + * positional_args = __provide_positional_args(args, + * self.__args, # <<<<<<<<<<<<<< + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, */ __pyx_t_1 = __pyx_v_self->__pyx___args; __Pyx_INCREF(__pyx_t_1); - /* "dependency_injector/providers/callables.pxd":31 - * cdef dict keyword_args + /* "dependency_injector/providers/callables.pxd":36 + * cdef dict keyword_args * - * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< - * self.__args, - * self.__args_len) + * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< + * self.__args, + * self.__args_len) */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 31, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/callables.pxd":35 - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, - * self.__kwargs, # <<<<<<<<<<<<<< - * self.__kwargs_len) + /* "dependency_injector/providers/callables.pxd":40 + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, + * self.__kwargs, # <<<<<<<<<<<<<< + * self.__kwargs_len) * */ __pyx_t_2 = __pyx_v_self->__pyx___kwargs; __Pyx_INCREF(__pyx_t_2); - /* "dependency_injector/providers/callables.pxd":34 - * self.__args, - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< - * self.__kwargs, - * self.__kwargs_len) + /* "dependency_injector/providers/callables.pxd":39 + * self.__args, + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< + * self.__kwargs, + * self.__kwargs_len) */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_keyword_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/callables.pxd":38 - * self.__kwargs_len) - * - * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< - * + /* "dependency_injector/providers/callables.pxd":43 + * self.__kwargs_len) * + * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_positional_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 38, __pyx_L1_error) + __PYX_ERR(2, 43, __pyx_L1_error) } if (unlikely(__pyx_v_keyword_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(2, 38, __pyx_L1_error) + __PYX_ERR(2, 43, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 38, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "dependency_injector/providers/callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("dependency_injector.providers.callables.Callable.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.callables.__call", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_positional_args); @@ -4425,9 +4283,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 72, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 76, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 110, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -4540,13 +4398,12 @@ PyMODINIT_FUNC PyInit_callables(void) __pyx_vtabptr_19dependency_injector_9providers_9callables_Callable = &__pyx_vtable_19dependency_injector_9providers_9callables_Callable; __pyx_vtable_19dependency_injector_9providers_9callables_Callable.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_4base_Provider; __pyx_vtable_19dependency_injector_9providers_9callables_Callable.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_4base_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_9callables_8Callable__provide; - __pyx_vtable_19dependency_injector_9providers_9callables_Callable.__pyx___provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *))__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide; __pyx_type_19dependency_injector_9providers_9callables_Callable.tp_base = __pyx_ptype_19dependency_injector_9providers_4base_Provider; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9callables_Callable) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9callables_Callable) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_9callables_Callable.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_Callable, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 21, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_Callable, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 22, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_9callables_8Callable___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_9callables_8Callable___init__.doc = __pyx_doc_19dependency_injector_9providers_9callables_8Callable___init__; @@ -4556,7 +4413,7 @@ PyMODINIT_FUNC PyInit_callables(void) #endif #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_Callable, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 21, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_Callable, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 22, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_9callables_8Callable_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_9callables_8Callable_4__str__.doc = __pyx_doc_19dependency_injector_9providers_9callables_8Callable_4__str__; @@ -4564,16 +4421,16 @@ PyMODINIT_FUNC PyInit_callables(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9callables_Callable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9callables_Callable) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Callable", (PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_Callable) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9callables_Callable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9callables_Callable) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Callable", (PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_Callable) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_9callables_Callable = &__pyx_type_19dependency_injector_9providers_9callables_Callable; __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable = &__pyx_vtable_19dependency_injector_9providers_9callables_DelegatedCallable; __pyx_vtable_19dependency_injector_9providers_9callables_DelegatedCallable.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable; __pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable.tp_base = __pyx_ptype_19dependency_injector_9providers_9callables_Callable; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable) < 0) __PYX_ERR(0, 202, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable) < 0) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable) < 0) __PYX_ERR(0, 202, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "DelegatedCallable", (PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable) < 0) __PYX_ERR(0, 202, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable) < 0) __PYX_ERR(0, 203, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DelegatedCallable", (PyObject *)&__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable) < 0) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = &__pyx_type_19dependency_injector_9providers_9callables_DelegatedCallable; /*--- Type import code ---*/ __pyx_ptype_19dependency_injector_9providers_4base_Object = __Pyx_ImportType("dependency_injector.providers.base", "Object", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Object), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Object)) __PYX_ERR(3, 15, __pyx_L1_error) @@ -4584,10 +4441,8 @@ PyMODINIT_FUNC PyInit_callables(void) __pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency)) __PYX_ERR(3, 25, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_4base_OverridingContext = __Pyx_ImportType("dependency_injector.providers.base", "OverridingContext", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_OverridingContext)) __PYX_ERR(3, 29, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10injections_Injection = __Pyx_ImportType("dependency_injector.providers.injections", "Injection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = __Pyx_ImportType("dependency_injector.providers.injections", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection = (struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = __Pyx_ImportType("dependency_injector.providers.injections", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 25, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection = (struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = __Pyx_ImportType("dependency_injector.providers.injections", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = __Pyx_ImportType("dependency_injector.providers.injections", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 20, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("dependency_injector.providers.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "CLASS_TYPES", (void **)&__pyx_vp_19dependency_injector_9providers_5utils_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4627,12 +4482,12 @@ PyMODINIT_FUNC PyInit_callables(void) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/callables.pyx":208 + /* "dependency_injector/providers/callables.pyx":209 * """ * * __IS_DELEGATED__ = True # <<<<<<<<<<<<<< */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 208, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 209, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable); /* "dependency_injector/providers/callables.pyx":1 @@ -4645,12 +4500,12 @@ PyMODINIT_FUNC PyInit_callables(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "dependency_injector/providers/callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ /*--- Wrapped vars code ---*/ diff --git a/src/dependency_injector/providers/callables.pxd b/src/dependency_injector/providers/callables.pxd index f529526b..ee0da937 100644 --- a/src/dependency_injector/providers/callables.pxd +++ b/src/dependency_injector/providers/callables.pxd @@ -24,19 +24,20 @@ cdef class Callable(Provider): cpdef object _provide(self, tuple args, dict kwargs) - cdef inline object __provide(self, tuple args, dict kwargs): - cdef tuple positional_args - cdef dict keyword_args - - positional_args = __provide_positional_args(args, - self.__args, - self.__args_len) - keyword_args = __provide_keyword_args(kwargs, - self.__kwargs, - self.__kwargs_len) - - return self.__provides(*positional_args, **keyword_args) - cdef class DelegatedCallable(Callable): pass + + +cdef inline object __call(Callable self, tuple args, dict kwargs): + cdef tuple positional_args + cdef dict keyword_args + + positional_args = __provide_positional_args(args, + self.__args, + self.__args_len) + keyword_args = __provide_keyword_args(kwargs, + self.__kwargs, + self.__kwargs_len) + + return self.__provides(*positional_args, **keyword_args) diff --git a/src/dependency_injector/providers/callables.pyx b/src/dependency_injector/providers/callables.pyx index c3eef390..8258e258 100644 --- a/src/dependency_injector/providers/callables.pyx +++ b/src/dependency_injector/providers/callables.pyx @@ -6,6 +6,7 @@ Powered by Cython. from dependency_injector.errors import Error from .base cimport Provider +from .callables cimport __call from .injections cimport ( PositionalInjection, NamedInjection, @@ -196,7 +197,7 @@ cdef class Callable(Provider): cpdef object _provide(self, tuple args, dict kwargs): """Return result of provided callable's call.""" - return self.__provide(args, kwargs) + return __call(self, args, kwargs) cdef class DelegatedCallable(Callable): diff --git a/src/dependency_injector/providers/factories.c b/src/dependency_injector/providers/factories.c index d41cd276..0efb2cc9 100644 --- a/src/dependency_injector/providers/factories.c +++ b/src/dependency_injector/providers/factories.c @@ -718,24 +718,11 @@ struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext { * * * cdef class Injection(object): # <<<<<<<<<<<<<< - * pass - * - */ -struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { - PyObject_HEAD -}; - - -/* "injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< * cdef object __value * cdef int __is_provider */ -struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { - struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtab; +struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { + PyObject_HEAD PyObject *__pyx___value; int __pyx___is_provider; int __pyx___is_delegated; @@ -743,21 +730,28 @@ struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjecti }; -/* "injections.pxd":25 +/* "injections.pxd":16 + * + * + * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; +}; + + +/* "injections.pxd":20 * * * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< * cdef object __name - * cdef object __value + * */ struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection { struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtab; PyObject *__pyx___name; - PyObject *__pyx___value; - int __pyx___is_provider; - int __pyx___is_delegated; - int __pyx___call; }; @@ -778,18 +772,19 @@ struct __pyx_obj_19dependency_injector_9providers_9callables_Callable { }; -/* "callables.pxd":41 +/* "callables.pxd":28 * * * cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable { struct __pyx_obj_19dependency_injector_9providers_9callables_Callable __pyx_base; }; -/* "dependency_injector/providers/factories.pxd":11 +/* "dependency_injector/providers/factories.pxd":14 * * * cdef class Factory(Provider): # <<<<<<<<<<<<<< @@ -804,11 +799,12 @@ struct __pyx_obj_19dependency_injector_9providers_9factories_Factory { }; -/* "dependency_injector/providers/factories.pxd":32 +/* "dependency_injector/providers/factories.pxd":23 * * * cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_obj_19dependency_injector_9providers_9factories_DelegatedFactory { struct __pyx_obj_19dependency_injector_9providers_9factories_Factory __pyx_base; @@ -873,38 +869,6 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependenc static struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency *__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency; -/* "injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< - * cdef object __value - * cdef int __is_provider - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection { - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); - - -/* "injections.pxd":25 - * - * - * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< - * cdef object __name - * cdef object __value - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection { - PyObject *(*__pyx___get_name)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - - /* "callables.pxd":16 * * @@ -915,17 +879,16 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable { struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable *__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); -/* "callables.pxd":41 +/* "callables.pxd":28 * * * cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable { @@ -934,7 +897,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCal static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable *__pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable; -/* "dependency_injector/providers/factories.pyx":20 +/* "dependency_injector/providers/factories.pyx":21 * * * cdef class Factory(Provider): # <<<<<<<<<<<<<< @@ -944,13 +907,11 @@ static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Deleg struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_Factory { struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_Factory *__pyx_vtabptr_19dependency_injector_9providers_9factories_Factory; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *); -/* "dependency_injector/providers/factories.pyx":253 +/* "dependency_injector/providers/factories.pyx":254 * * * cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<< @@ -1276,11 +1237,6 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory__provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ /* Module declarations from 'dependency_injector.providers.base' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_4base_Provider = 0; @@ -1295,6 +1251,8 @@ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_4base_Overridi static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_Injection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(PyObject *, PyObject *, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(PyObject *, PyObject *, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___inject_attributes(PyObject *, PyObject *, int); /*proto*/ @@ -1303,6 +1261,7 @@ static PyObject *(*__pyx_f_19dependency_injector_9providers_10injections_parse_n /* Module declarations from 'dependency_injector.providers.callables' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9callables_Callable = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables___call(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); /*proto*/ /* Module declarations from 'dependency_injector.providers.utils' */ static PyObject **__pyx_vp_19dependency_injector_9providers_5utils_CLASS_TYPES = 0; @@ -1313,6 +1272,7 @@ static PyObject *(*__pyx_f_19dependency_injector_9providers_5utils_deepcopy)(PyO /* Module declarations from 'dependency_injector.providers.factories' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9factories_Factory = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories___call(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "dependency_injector.providers.factories" int __pyx_module_is_main_dependency_injector__providers__factories = 0; @@ -1403,7 +1363,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 static PyObject *__pyx_tp_new_19dependency_injector_9providers_9factories_Factory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_19dependency_injector_9providers_9factories_DelegatedFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -/* "dependency_injector/providers/factories.pyx":73 +/* "dependency_injector/providers/factories.pyx":74 * provided_type = None * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -1456,7 +1416,7 @@ static int __pyx_pw_19dependency_injector_9providers_9factories_7Factory_1__init } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -1467,7 +1427,7 @@ static int __pyx_pw_19dependency_injector_9providers_9factories_7Factory_1__init } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -1501,19 +1461,19 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/factories.pyx":85 + /* "dependency_injector/providers/factories.pyx":86 * :type kwargs: dict[str, object] * """ * if (self.__class__.provided_type and # <<<<<<<<<<<<<< * not issubclass(provides, self.__class__.provided_type)): * raise Error('{0} can provide only {1} instances'.format( */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { @@ -1521,25 +1481,25 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ goto __pyx_L4_bool_binop_done; } - /* "dependency_injector/providers/factories.pyx":86 + /* "dependency_injector/providers/factories.pyx":87 * """ * if (self.__class__.provided_type and * not issubclass(provides, self.__class__.provided_type)): # <<<<<<<<<<<<<< * raise Error('{0} can provide only {1} instances'.format( * self.__class__, self.__class__.provided_type)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = PyObject_IsSubclass(__pyx_v_provides, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_4 = PyObject_IsSubclass(__pyx_v_provides, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); __pyx_t_1 = __pyx_t_5; __pyx_L4_bool_binop_done:; - /* "dependency_injector/providers/factories.pyx":85 + /* "dependency_injector/providers/factories.pyx":86 * :type kwargs: dict[str, object] * """ * if (self.__class__.provided_type and # <<<<<<<<<<<<<< @@ -1548,30 +1508,30 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ */ if (__pyx_t_1) { - /* "dependency_injector/providers/factories.pyx":87 + /* "dependency_injector/providers/factories.pyx":88 * if (self.__class__.provided_type and * not issubclass(provides, self.__class__.provided_type)): * raise Error('{0} can provide only {1} instances'.format( # <<<<<<<<<<<<<< * self.__class__, self.__class__.provided_type)) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_provide_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_provide_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "dependency_injector/providers/factories.pyx":88 + /* "dependency_injector/providers/factories.pyx":89 * not issubclass(provides, self.__class__.provided_type)): * raise Error('{0} can provide only {1} instances'.format( * self.__class__, self.__class__.provided_type)) # <<<<<<<<<<<<<< * * self.__instantiator = Callable(provides, *args, **kwargs) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -1589,7 +1549,7 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -1599,7 +1559,7 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -1607,7 +1567,7 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -1618,7 +1578,7 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -1634,14 +1594,14 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ } } if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -1650,20 +1610,20 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -1671,9 +1631,9 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ __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, 87, __pyx_L1_error) + __PYX_ERR(0, 88, __pyx_L1_error) - /* "dependency_injector/providers/factories.pyx":85 + /* "dependency_injector/providers/factories.pyx":86 * :type kwargs: dict[str, object] * """ * if (self.__class__.provided_type and # <<<<<<<<<<<<<< @@ -1682,22 +1642,22 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ */ } - /* "dependency_injector/providers/factories.pyx":90 + /* "dependency_injector/providers/factories.pyx":91 * self.__class__, self.__class__.provided_type)) * * self.__instantiator = Callable(provides, *args, **kwargs) # <<<<<<<<<<<<<< * * self.__attributes = tuple() */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_provides); __Pyx_GIVEREF(__pyx_v_provides); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9callables_Callable), __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9callables_Callable), __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); @@ -1706,14 +1666,14 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ __pyx_v_self->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":92 + /* "dependency_injector/providers/factories.pyx":93 * self.__instantiator = Callable(provides, *args, **kwargs) * * self.__attributes = tuple() # <<<<<<<<<<<<<< * self.__attributes_len = 0 * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->__pyx___attributes); @@ -1721,7 +1681,7 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ __pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":93 + /* "dependency_injector/providers/factories.pyx":94 * * self.__attributes = tuple() * self.__attributes_len = 0 # <<<<<<<<<<<<<< @@ -1730,14 +1690,14 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ */ __pyx_v_self->__pyx___attributes_len = 0; - /* "dependency_injector/providers/factories.pyx":95 + /* "dependency_injector/providers/factories.pyx":96 * self.__attributes_len = 0 * * super(Factory, self).__init__() # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_Factory)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_Factory)); @@ -1745,10 +1705,10 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -1762,16 +1722,16 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ } } if (__pyx_t_12) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":73 + /* "dependency_injector/providers/factories.pyx":74 * provided_type = None * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -1798,7 +1758,7 @@ static int __pyx_pf_19dependency_injector_9providers_9factories_7Factory___init_ return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":97 +/* "dependency_injector/providers/factories.pyx":98 * super(Factory, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -1838,21 +1798,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__deepcopy__", 0); - /* "dependency_injector/providers/factories.pyx":99 + /* "dependency_injector/providers/factories.pyx":100 * def __deepcopy__(self, memo): * """Create and return full copy of provider.""" * copied = memo.get(id(self)) # <<<<<<<<<<<<<< * if copied is not None: * return copied */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -1866,14 +1826,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1882,20 +1842,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -1904,7 +1864,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_v_copied = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":100 + /* "dependency_injector/providers/factories.pyx":101 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1915,7 +1875,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "dependency_injector/providers/factories.pyx":101 + /* "dependency_injector/providers/factories.pyx":102 * copied = memo.get(id(self)) * if copied is not None: * return copied # <<<<<<<<<<<<<< @@ -1927,7 +1887,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":100 + /* "dependency_injector/providers/factories.pyx":101 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1936,91 +1896,91 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 */ } - /* "dependency_injector/providers/factories.pyx":103 + /* "dependency_injector/providers/factories.pyx":104 * return copied * * copied = self.__class__(self.cls, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":104 + /* "dependency_injector/providers/factories.pyx":105 * * copied = self.__class__(self.cls, * *deepcopy(self.args, memo), # <<<<<<<<<<<<<< * **deepcopy(self.kwargs, memo)) * copied.set_attributes(**deepcopy(self.attributes, memo)) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 104, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":103 + /* "dependency_injector/providers/factories.pyx":104 * return copied * * copied = self.__class__(self.cls, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":105 + /* "dependency_injector/providers/factories.pyx":106 * copied = self.__class__(self.cls, * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) # <<<<<<<<<<<<<< * copied.set_attributes(**deepcopy(self.attributes, memo)) * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 105, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 105, __pyx_L1_error) + __PYX_ERR(0, 106, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_3))) { - __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "dependency_injector/providers/factories.pyx":103 + /* "dependency_injector/providers/factories.pyx":104 * return copied * * copied = self.__class__(self.cls, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2028,58 +1988,58 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/factories.pyx":106 + /* "dependency_injector/providers/factories.pyx":107 * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) * copied.set_attributes(**deepcopy(self.attributes, memo)) # <<<<<<<<<<<<<< * * for overriding_provider in self.overridden: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 106, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 107, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_4, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_4, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 106, __pyx_L1_error) + __PYX_ERR(0, 107, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_1))) { - __pyx_t_2 = PyDict_Copy(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = PyDict_Copy(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":108 + /* "dependency_injector/providers/factories.pyx":109 * copied.set_attributes(**deepcopy(self.attributes, memo)) * * for overriding_provider in self.overridden: # <<<<<<<<<<<<<< * copied.override(deepcopy(overriding_provider, memo)) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __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_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 109, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -2087,17 +2047,17 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -2107,7 +2067,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 108, __pyx_L1_error) + else __PYX_ERR(0, 109, __pyx_L1_error) } break; } @@ -2116,19 +2076,19 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":109 + /* "dependency_injector/providers/factories.pyx":110 * * for overriding_provider in self.overridden: * copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<< * * return copied */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 109, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -2141,14 +2101,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 } } if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2157,20 +2117,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -2178,7 +2138,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":108 + /* "dependency_injector/providers/factories.pyx":109 * copied.set_attributes(**deepcopy(self.attributes, memo)) * * for overriding_provider in self.overridden: # <<<<<<<<<<<<<< @@ -2188,7 +2148,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":111 + /* "dependency_injector/providers/factories.pyx":112 * copied.override(deepcopy(overriding_provider, memo)) * * return copied # <<<<<<<<<<<<<< @@ -2200,7 +2160,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":97 + /* "dependency_injector/providers/factories.pyx":98 * super(Factory, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -2226,7 +2186,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":113 +/* "dependency_injector/providers/factories.pyx":114 * return copied * * def __str__(self): # <<<<<<<<<<<<<< @@ -2258,7 +2218,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_4 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__str__", 0); - /* "dependency_injector/providers/factories.pyx":118 + /* "dependency_injector/providers/factories.pyx":119 * :rtype: str * """ * return represent_provider(provider=self, # <<<<<<<<<<<<<< @@ -2267,31 +2227,31 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_4 */ __Pyx_XDECREF(__pyx_r); - /* "dependency_injector/providers/factories.pyx":119 + /* "dependency_injector/providers/factories.pyx":120 * """ * return represent_provider(provider=self, * provides=self.__instantiator.provides) # <<<<<<<<<<<<<< * * @property */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_provides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_provides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/providers/factories.pyx":118 + /* "dependency_injector/providers/factories.pyx":119 * :rtype: str * """ * return represent_provider(provider=self, # <<<<<<<<<<<<<< * provides=self.__instantiator.provides) * */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_5utils_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_5utils_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":113 + /* "dependency_injector/providers/factories.pyx":114 * return copied * * def __str__(self): # <<<<<<<<<<<<<< @@ -2311,7 +2271,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_4 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":122 +/* "dependency_injector/providers/factories.pyx":123 * * @property * def cls(self): # <<<<<<<<<<<<<< @@ -2338,7 +2298,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_3 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/factories.pyx":124 + /* "dependency_injector/providers/factories.pyx":125 * def cls(self): * """Return provided type.""" * return self.__instantiator.provides # <<<<<<<<<<<<<< @@ -2346,13 +2306,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_3 * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_provides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_provides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":122 + /* "dependency_injector/providers/factories.pyx":123 * * @property * def cls(self): # <<<<<<<<<<<<<< @@ -2371,7 +2331,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_3 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":127 +/* "dependency_injector/providers/factories.pyx":128 * * @property * def args(self): # <<<<<<<<<<<<<< @@ -2398,7 +2358,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/factories.pyx":129 + /* "dependency_injector/providers/factories.pyx":130 * def args(self): * """Return positional argument injections.""" * return self.__instantiator.args # <<<<<<<<<<<<<< @@ -2406,13 +2366,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_4 * def add_args(self, *args): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":127 + /* "dependency_injector/providers/factories.pyx":128 * * @property * def args(self): # <<<<<<<<<<<<<< @@ -2431,7 +2391,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_4 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":131 +/* "dependency_injector/providers/factories.pyx":132 * return self.__instantiator.args * * def add_args(self, *args): # <<<<<<<<<<<<<< @@ -2465,21 +2425,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_6 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("add_args", 0); - /* "dependency_injector/providers/factories.pyx":139 + /* "dependency_injector/providers/factories.pyx":140 * :return: Reference ``self`` * """ * self.__instantiator.add_args(*args) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __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; - /* "dependency_injector/providers/factories.pyx":140 + /* "dependency_injector/providers/factories.pyx":141 * """ * self.__instantiator.add_args(*args) * return self # <<<<<<<<<<<<<< @@ -2491,7 +2451,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_6 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":131 + /* "dependency_injector/providers/factories.pyx":132 * return self.__instantiator.args * * def add_args(self, *args): # <<<<<<<<<<<<<< @@ -2511,7 +2471,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_6 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":142 +/* "dependency_injector/providers/factories.pyx":143 * return self * * def set_args(self, *args): # <<<<<<<<<<<<<< @@ -2545,21 +2505,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_8 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_args", 0); - /* "dependency_injector/providers/factories.pyx":152 + /* "dependency_injector/providers/factories.pyx":153 * :return: Reference ``self`` * """ * self.__instantiator.set_args(*args) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __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; - /* "dependency_injector/providers/factories.pyx":153 + /* "dependency_injector/providers/factories.pyx":154 * """ * self.__instantiator.set_args(*args) * return self # <<<<<<<<<<<<<< @@ -2571,7 +2531,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_8 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":142 + /* "dependency_injector/providers/factories.pyx":143 * return self * * def set_args(self, *args): # <<<<<<<<<<<<<< @@ -2591,7 +2551,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_8 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":155 +/* "dependency_injector/providers/factories.pyx":156 * return self * * def clear_args(self): # <<<<<<<<<<<<<< @@ -2621,14 +2581,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("clear_args", 0); - /* "dependency_injector/providers/factories.pyx":160 + /* "dependency_injector/providers/factories.pyx":161 * :return: Reference ``self`` * """ * self.__instantiator.clear_args() # <<<<<<<<<<<<<< * return self * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2641,16 +2601,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":161 + /* "dependency_injector/providers/factories.pyx":162 * """ * self.__instantiator.clear_args() * return self # <<<<<<<<<<<<<< @@ -2662,7 +2622,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":155 + /* "dependency_injector/providers/factories.pyx":156 * return self * * def clear_args(self): # <<<<<<<<<<<<<< @@ -2683,7 +2643,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":164 +/* "dependency_injector/providers/factories.pyx":165 * * @property * def kwargs(self): # <<<<<<<<<<<<<< @@ -2710,7 +2670,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_6 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/factories.pyx":166 + /* "dependency_injector/providers/factories.pyx":167 * def kwargs(self): * """Return keyword argument injections.""" * return self.__instantiator.kwargs # <<<<<<<<<<<<<< @@ -2718,13 +2678,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_6 * def add_kwargs(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":164 + /* "dependency_injector/providers/factories.pyx":165 * * @property * def kwargs(self): # <<<<<<<<<<<<<< @@ -2743,7 +2703,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_6 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":168 +/* "dependency_injector/providers/factories.pyx":169 * return self.__instantiator.kwargs * * def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2783,21 +2743,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("add_kwargs", 0); - /* "dependency_injector/providers/factories.pyx":176 + /* "dependency_injector/providers/factories.pyx":177 * :return: Reference ``self`` * """ * self.__instantiator.add_kwargs(**kwargs) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __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; - /* "dependency_injector/providers/factories.pyx":177 + /* "dependency_injector/providers/factories.pyx":178 * """ * self.__instantiator.add_kwargs(**kwargs) * return self # <<<<<<<<<<<<<< @@ -2809,7 +2769,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":168 + /* "dependency_injector/providers/factories.pyx":169 * return self.__instantiator.kwargs * * def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2829,7 +2789,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":179 +/* "dependency_injector/providers/factories.pyx":180 * return self * * def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2869,21 +2829,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_kwargs", 0); - /* "dependency_injector/providers/factories.pyx":189 + /* "dependency_injector/providers/factories.pyx":190 * :return: Reference ``self`` * """ * self.__instantiator.set_kwargs(**kwargs) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __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; - /* "dependency_injector/providers/factories.pyx":190 + /* "dependency_injector/providers/factories.pyx":191 * """ * self.__instantiator.set_kwargs(**kwargs) * return self # <<<<<<<<<<<<<< @@ -2895,7 +2855,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":179 + /* "dependency_injector/providers/factories.pyx":180 * return self * * def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -2915,7 +2875,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":192 +/* "dependency_injector/providers/factories.pyx":193 * return self * * def clear_kwargs(self): # <<<<<<<<<<<<<< @@ -2945,14 +2905,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("clear_kwargs", 0); - /* "dependency_injector/providers/factories.pyx":197 + /* "dependency_injector/providers/factories.pyx":198 * :return: Reference ``self`` * """ * self.__instantiator.clear_kwargs() # <<<<<<<<<<<<<< * return self * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2965,16 +2925,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":198 + /* "dependency_injector/providers/factories.pyx":199 * """ * self.__instantiator.clear_kwargs() * return self # <<<<<<<<<<<<<< @@ -2986,7 +2946,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":192 + /* "dependency_injector/providers/factories.pyx":193 * return self * * def clear_kwargs(self): # <<<<<<<<<<<<<< @@ -3007,7 +2967,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":201 +/* "dependency_injector/providers/factories.pyx":202 * * @property * def attributes(self): # <<<<<<<<<<<<<< @@ -3039,19 +2999,19 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 int __pyx_t_3; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/factories.pyx":207 + /* "dependency_injector/providers/factories.pyx":208 * cdef dict attributes * * attributes = dict() # <<<<<<<<<<<<<< * for index in range(self.__attributes_len): * attribute = self.__attributes[index] */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attributes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":208 + /* "dependency_injector/providers/factories.pyx":209 * * attributes = dict() * for index in range(self.__attributes_len): # <<<<<<<<<<<<<< @@ -3062,7 +3022,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_index = __pyx_t_3; - /* "dependency_injector/providers/factories.pyx":209 + /* "dependency_injector/providers/factories.pyx":210 * attributes = dict() * for index in range(self.__attributes_len): * attribute = self.__attributes[index] # <<<<<<<<<<<<<< @@ -3071,28 +3031,28 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 */ if (unlikely(__pyx_v_self->__pyx___attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 210, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___attributes, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___attributes, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection))))) __PYX_ERR(0, 209, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection))))) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_attribute, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_1)); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":210 + /* "dependency_injector/providers/factories.pyx":211 * for index in range(self.__attributes_len): * attribute = self.__attributes[index] * attributes[attribute.__name] = attribute.__value # <<<<<<<<<<<<<< * return attributes * */ - __pyx_t_1 = __pyx_v_attribute->__pyx___value; + __pyx_t_1 = __pyx_v_attribute->__pyx_base.__pyx___value; __Pyx_INCREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_v_attribute->__pyx___name, __pyx_t_1) < 0)) __PYX_ERR(0, 210, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_v_attribute->__pyx___name, __pyx_t_1) < 0)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/factories.pyx":211 + /* "dependency_injector/providers/factories.pyx":212 * attribute = self.__attributes[index] * attributes[attribute.__name] = attribute.__value * return attributes # <<<<<<<<<<<<<< @@ -3104,7 +3064,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_r = __pyx_v_attributes; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":201 + /* "dependency_injector/providers/factories.pyx":202 * * @property * def attributes(self): # <<<<<<<<<<<<<< @@ -3125,7 +3085,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":213 +/* "dependency_injector/providers/factories.pyx":214 * return attributes * * def add_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3162,16 +3122,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 Py_ssize_t __pyx_t_3; __Pyx_RefNannySetupContext("add_attributes", 0); - /* "dependency_injector/providers/factories.pyx":221 + /* "dependency_injector/providers/factories.pyx":222 * :return: Reference ``self`` * """ * self.__attributes += parse_named_injections(kwargs) # <<<<<<<<<<<<<< * self.__attributes_len = len(self.__attributes) * return self */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___attributes, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___attributes, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); @@ -3180,7 +3140,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pyx":222 + /* "dependency_injector/providers/factories.pyx":223 * """ * self.__attributes += parse_named_injections(kwargs) * self.__attributes_len = len(self.__attributes) # <<<<<<<<<<<<<< @@ -3191,13 +3151,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 222, __pyx_L1_error) + __PYX_ERR(0, 223, __pyx_L1_error) } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->__pyx___attributes_len = __pyx_t_3; - /* "dependency_injector/providers/factories.pyx":223 + /* "dependency_injector/providers/factories.pyx":224 * self.__attributes += parse_named_injections(kwargs) * self.__attributes_len = len(self.__attributes) * return self # <<<<<<<<<<<<<< @@ -3209,7 +3169,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":213 + /* "dependency_injector/providers/factories.pyx":214 * return attributes * * def add_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3229,7 +3189,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_1 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":225 +/* "dependency_injector/providers/factories.pyx":226 * return self * * def set_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3265,14 +3225,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("set_attributes", 0); - /* "dependency_injector/providers/factories.pyx":235 + /* "dependency_injector/providers/factories.pyx":236 * :return: Reference ``self`` * """ * self.__attributes = parse_named_injections(kwargs) # <<<<<<<<<<<<<< * self.__attributes_len = len(self.__attributes) * return self */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___attributes); @@ -3280,7 +3240,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":236 + /* "dependency_injector/providers/factories.pyx":237 * """ * self.__attributes = parse_named_injections(kwargs) * self.__attributes_len = len(self.__attributes) # <<<<<<<<<<<<<< @@ -3291,13 +3251,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx___attributes_len = __pyx_t_2; - /* "dependency_injector/providers/factories.pyx":237 + /* "dependency_injector/providers/factories.pyx":238 * self.__attributes = parse_named_injections(kwargs) * self.__attributes_len = len(self.__attributes) * return self # <<<<<<<<<<<<<< @@ -3309,7 +3269,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":225 + /* "dependency_injector/providers/factories.pyx":226 * return self * * def set_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3328,7 +3288,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":239 +/* "dependency_injector/providers/factories.pyx":240 * return self * * def clear_attributes(self): # <<<<<<<<<<<<<< @@ -3357,14 +3317,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("clear_attributes", 0); - /* "dependency_injector/providers/factories.pyx":244 + /* "dependency_injector/providers/factories.pyx":245 * :return: Reference ``self`` * """ * self.__attributes = tuple() # <<<<<<<<<<<<<< * self.__attributes_len = len(self.__attributes) * return self */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___attributes); @@ -3372,7 +3332,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/factories.pyx":245 + /* "dependency_injector/providers/factories.pyx":246 * """ * self.__attributes = tuple() * self.__attributes_len = len(self.__attributes) # <<<<<<<<<<<<<< @@ -3383,13 +3343,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 245, __pyx_L1_error) + __PYX_ERR(0, 246, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx___attributes_len = __pyx_t_2; - /* "dependency_injector/providers/factories.pyx":246 + /* "dependency_injector/providers/factories.pyx":247 * self.__attributes = tuple() * self.__attributes_len = len(self.__attributes) * return self # <<<<<<<<<<<<<< @@ -3401,7 +3361,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":239 + /* "dependency_injector/providers/factories.pyx":240 * return self * * def clear_attributes(self): # <<<<<<<<<<<<<< @@ -3420,12 +3380,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 return __pyx_r; } -/* "dependency_injector/providers/factories.pyx":248 +/* "dependency_injector/providers/factories.pyx":249 * return self * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return new instance.""" - * return self.__provide(args, kwargs) + * return __call(self, args, kwargs) */ static PyObject *__pyx_pw_19dependency_injector_9providers_9factories_7Factory_25_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -3443,7 +3403,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory__p if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_9factories_7Factory_25_provide)) { __Pyx_XDECREF(__pyx_r); @@ -3463,7 +3423,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory__p #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -3471,13 +3431,13 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -3488,7 +3448,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory__p __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -3501,26 +3461,26 @@ static PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory__p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/factories.pyx":250 + /* "dependency_injector/providers/factories.pyx":251 * cpdef object _provide(self, tuple args, dict kwargs): * """Return new instance.""" - * return self.__provide(args, kwargs) # <<<<<<<<<<<<<< + * return __call(self, args, kwargs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9factories___call(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/factories.pyx":248 + /* "dependency_injector/providers/factories.pyx":249 * return self * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return new instance.""" - * return self.__provide(args, kwargs) + * return __call(self, args, kwargs) */ /* function exit code */ @@ -3567,11 +3527,11 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_9factories_7Factory_2 case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 248, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 249, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 248, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 249, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3584,14 +3544,14 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_9factories_7Factory_2 } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.factories.Factory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 248, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_9factories_7Factory_24_provide(((struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ @@ -3609,7 +3569,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_provide", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9factories_7Factory__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9factories_7Factory__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3626,136 +3586,36 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_9factories_7Factory_2 return __pyx_r; } -/* "injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__get_value", 0); - - /* "injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); - if (__pyx_t_1) { - - /* "injections.pxd":21 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_r = __pyx_v_self->__pyx___value; - goto __pyx_L0; - - /* "injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - } - - /* "injections.pxd":22 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< +/* "injections.pxd":24 * * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_t_3 = __pyx_v_self->__pyx___value; __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && 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); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.PositionalInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "injections.pxd":32 - * cdef int __call - * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get_name", 0); - /* "injections.pxd":33 + /* "injections.pxd":25 + * + * cdef inline object __get_name(NamedInjection self): + * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_name(self): - * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_value(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx___name); __pyx_r = __pyx_v_self->__pyx___name; goto __pyx_L0; - /* "injections.pxd":32 - * cdef int __call + /* "injections.pxd":24 * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ @@ -3766,15 +3626,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":35 - * return self.__name +/* "injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3783,21 +3643,21 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get_value", 0); - /* "injections.pxd":36 + /* "injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); if (__pyx_t_1) { - /* "injections.pxd":37 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() + /* "injections.pxd":30 + * cdef inline object __get_value(Injection self): + * if self.__call == 0: + * return self.__value # <<<<<<<<<<<<<< + * return self.__value() * */ __Pyx_XDECREF(__pyx_r); @@ -3805,19 +3665,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_self->__pyx___value; goto __pyx_L0; - /* "injections.pxd":36 + /* "injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ } - /* "injections.pxd":38 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< + /* "injections.pxd":31 + * if self.__call == 0: + * return self.__value + * return self.__value() # <<<<<<<<<<<<<< * * */ @@ -3834,10 +3694,10 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3845,12 +3705,12 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_2 = 0; goto __pyx_L0; - /* "injections.pxd":35 - * return self.__name + /* "injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ /* function exit code */ @@ -3858,7 +3718,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.NamedInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.injections.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3866,7 +3726,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":43 +/* "injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -3887,7 +3747,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__provide_positional_args", 0); - /* "injections.pxd":50 + /* "injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -3897,7 +3757,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0); if (__pyx_t_1) { - /* "injections.pxd":51 + /* "injections.pxd":44 * * if inj_args_len == 0: * return args # <<<<<<<<<<<<<< @@ -3909,7 +3769,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_args; goto __pyx_L0; - /* "injections.pxd":50 + /* "injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -3918,68 +3778,68 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ } - /* "injections.pxd":53 + /* "injections.pxd":46 * return args * * positional_args = list() # <<<<<<<<<<<<<< * for index in range(inj_args_len): * injection = inj_args[index] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "injections.pxd":54 + /* "injections.pxd":47 * * positional_args = list() * for index in range(inj_args_len): # <<<<<<<<<<<<<< * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) */ __pyx_t_3 = __pyx_v_inj_args_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":55 + /* "injections.pxd":48 * positional_args = list() * for index in range(inj_args_len): * injection = inj_args[index] # <<<<<<<<<<<<<< - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) */ if (unlikely(__pyx_v_inj_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 55, __pyx_L1_error) + __PYX_ERR(1, 48, __pyx_L1_error) } __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)__pyx_t_2)); __pyx_t_2 = 0; - /* "injections.pxd":56 + /* "injections.pxd":49 * for index in range(inj_args_len): * injection = inj_args[index] - * positional_args.append(injection.__get_value()) # <<<<<<<<<<<<<< + * positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<< * positional_args.extend(args) * */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(__pyx_v_injection); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 56, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "injections.pxd":57 + /* "injections.pxd":50 * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) # <<<<<<<<<<<<<< * * return tuple(positional_args) */ - __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 57, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 50, __pyx_L1_error) - /* "injections.pxd":59 + /* "injections.pxd":52 * positional_args.extend(args) * * return tuple(positional_args) # <<<<<<<<<<<<<< @@ -3987,13 +3847,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "injections.pxd":43 + /* "injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -4014,7 +3874,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":64 +/* "injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -4036,7 +3896,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_6; __Pyx_RefNannySetupContext("__provide_keyword_args", 0); - /* "injections.pxd":71 + /* "injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -4045,69 +3905,69 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 71, __pyx_L1_error) + __PYX_ERR(1, 64, __pyx_L1_error) } - __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 64, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "injections.pxd":72 + /* "injections.pxd":65 * * if len(kwargs) == 0: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":73 + /* "injections.pxd":66 * if len(kwargs) == 0: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 73, __pyx_L1_error) + __PYX_ERR(1, 66, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "injections.pxd":74 + /* "injections.pxd":67 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) * else: */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":75 + /* "injections.pxd":68 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * else: * for index in range(inj_kwargs_len): */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 75, __pyx_L1_error) + __PYX_ERR(1, 68, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 75, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - /* "injections.pxd":71 + /* "injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -4117,82 +3977,82 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject goto __pyx_L3; } - /* "injections.pxd":77 - * kwargs[name] = kw_injection.__get_value() + /* "injections.pxd":70 + * kwargs[name] = __get_value(kw_injection) * else: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ /*else*/ { __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":78 + /* "injections.pxd":71 * else: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 78, __pyx_L1_error) + __PYX_ERR(1, 71, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "injections.pxd":79 + /* "injections.pxd":72 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":80 + /* "injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 80, __pyx_L1_error) + __PYX_ERR(1, 73, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 80, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 73, __pyx_L1_error) __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { - /* "injections.pxd":81 - * name = kw_injection.__get_name() + /* "injections.pxd":74 + * name = __get_name(kw_injection) * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * * return kwargs */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 81, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 81, __pyx_L1_error) + __PYX_ERR(1, 74, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 81, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":80 + /* "injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ } @@ -4200,8 +4060,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } __pyx_L3:; - /* "injections.pxd":83 - * kwargs[name] = kw_injection.__get_value() + /* "injections.pxd":76 + * kwargs[name] = __get_value(kw_injection) * * return kwargs # <<<<<<<<<<<<<< * @@ -4212,7 +4072,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_kwargs; goto __pyx_L0; - /* "injections.pxd":64 + /* "injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -4233,7 +4093,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":88 +/* "injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -4253,7 +4113,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__inject_attributes", 0); - /* "injections.pxd":92 + /* "injections.pxd":85 * int attributes_len): * cdef NamedInjection attr_injection * for index in range(attributes_len): # <<<<<<<<<<<<<< @@ -4264,55 +4124,55 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_index = __pyx_t_2; - /* "injections.pxd":93 + /* "injections.pxd":86 * cdef NamedInjection attr_injection * for index in range(attributes_len): * attr_injection = attributes[index] # <<<<<<<<<<<<<< * setattr(instance, - * attr_injection.__get_name(), + * __get_name(attr_injection), */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 93, __pyx_L1_error) + __PYX_ERR(1, 86, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index); __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_3)); __pyx_t_3 = 0; - /* "injections.pxd":95 + /* "injections.pxd":88 * attr_injection = attributes[index] * setattr(instance, - * attr_injection.__get_name(), # <<<<<<<<<<<<<< - * attr_injection.__get_value()) + * __get_name(attr_injection), # <<<<<<<<<<<<<< + * __get_value(attr_injection)) * */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 95, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "injections.pxd":96 + /* "injections.pxd":89 * setattr(instance, - * attr_injection.__get_name(), - * attr_injection.__get_value()) # <<<<<<<<<<<<<< + * __get_name(attr_injection), + * __get_value(attr_injection)) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_attr_injection); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 96, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "injections.pxd":94 + /* "injections.pxd":87 * for index in range(attributes_len): * attr_injection = attributes[index] * setattr(instance, # <<<<<<<<<<<<<< - * attr_injection.__get_name(), - * attr_injection.__get_value()) + * __get_name(attr_injection), + * __get_value(attr_injection)) */ - __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "injections.pxd":88 + /* "injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -4335,81 +4195,83 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "dependency_injector/providers/factories.pxd":19 - * cpdef object _provide(self, tuple args, dict kwargs) +/* "dependency_injector/providers/factories.pxd":27 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance + * + * cdef inline object __call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef object instance * */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories___call(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_instance = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__call", 0); - /* "dependency_injector/providers/factories.pxd":22 - * cdef object instance + /* "dependency_injector/providers/factories.pxd":30 + * cdef object instance * - * instance = self.__instantiator.__provide(args, kwargs) # <<<<<<<<<<<<<< + * instance = __call_callable(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<< * - * if self.__attributes_len > 0: + * if self.__attributes_len > 0: */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(__pyx_v_self->__pyx___instantiator, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_instance = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___instantiator); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_9callables___call(((struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_instance = __pyx_t_2; + __pyx_t_2 = 0; - /* "dependency_injector/providers/factories.pxd":24 - * instance = self.__instantiator.__provide(args, kwargs) + /* "dependency_injector/providers/factories.pxd":32 + * instance = __call_callable(self.__instantiator, args, kwargs) * - * if self.__attributes_len > 0: # <<<<<<<<<<<<<< - * __inject_attributes(instance, - * self.__attributes, + * if self.__attributes_len > 0: # <<<<<<<<<<<<<< + * __inject_attributes(instance, + * self.__attributes, */ - __pyx_t_2 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0); - if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0); + if (__pyx_t_3) { - /* "dependency_injector/providers/factories.pxd":26 - * if self.__attributes_len > 0: - * __inject_attributes(instance, - * self.__attributes, # <<<<<<<<<<<<<< - * self.__attributes_len) + /* "dependency_injector/providers/factories.pxd":34 + * if self.__attributes_len > 0: + * __inject_attributes(instance, + * self.__attributes, # <<<<<<<<<<<<<< + * self.__attributes_len) * */ - __pyx_t_1 = __pyx_v_self->__pyx___attributes; - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self->__pyx___attributes; + __Pyx_INCREF(__pyx_t_2); - /* "dependency_injector/providers/factories.pxd":25 + /* "dependency_injector/providers/factories.pxd":33 * - * if self.__attributes_len > 0: - * __inject_attributes(instance, # <<<<<<<<<<<<<< - * self.__attributes, - * self.__attributes_len) + * if self.__attributes_len > 0: + * __inject_attributes(instance, # <<<<<<<<<<<<<< + * self.__attributes, + * self.__attributes_len) */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/factories.pxd":24 - * instance = self.__instantiator.__provide(args, kwargs) + /* "dependency_injector/providers/factories.pxd":32 + * instance = __call_callable(self.__instantiator, args, kwargs) * - * if self.__attributes_len > 0: # <<<<<<<<<<<<<< - * __inject_attributes(instance, - * self.__attributes, + * if self.__attributes_len > 0: # <<<<<<<<<<<<<< + * __inject_attributes(instance, + * self.__attributes, */ } - /* "dependency_injector/providers/factories.pxd":29 - * self.__attributes_len) - * - * return instance # <<<<<<<<<<<<<< + /* "dependency_injector/providers/factories.pxd":37 + * self.__attributes_len) * + * return instance # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); @@ -4417,19 +4279,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factori __pyx_r = __pyx_v_instance; goto __pyx_L0; - /* "dependency_injector/providers/factories.pxd":19 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "dependency_injector/providers/factories.pxd":27 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance + * + * cdef inline object __call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef object instance * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("dependency_injector.providers.factories.Factory.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("dependency_injector.providers.factories.__call", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_instance); @@ -4438,104 +4300,102 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factori return __pyx_r; } -/* "callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) +/* "callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables___call(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_positional_args = 0; PyObject *__pyx_v_keyword_args = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); + __Pyx_RefNannySetupContext("__call", 0); - /* "callables.pxd":32 + /* "callables.pxd":37 * - * positional_args = __provide_positional_args(args, - * self.__args, # <<<<<<<<<<<<<< - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, + * positional_args = __provide_positional_args(args, + * self.__args, # <<<<<<<<<<<<<< + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, */ __pyx_t_1 = __pyx_v_self->__pyx___args; __Pyx_INCREF(__pyx_t_1); - /* "callables.pxd":31 - * cdef dict keyword_args + /* "callables.pxd":36 + * cdef dict keyword_args * - * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< - * self.__args, - * self.__args_len) + * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< + * self.__args, + * self.__args_len) */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "callables.pxd":35 - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, - * self.__kwargs, # <<<<<<<<<<<<<< - * self.__kwargs_len) + /* "callables.pxd":40 + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, + * self.__kwargs, # <<<<<<<<<<<<<< + * self.__kwargs_len) * */ __pyx_t_2 = __pyx_v_self->__pyx___kwargs; __Pyx_INCREF(__pyx_t_2); - /* "callables.pxd":34 - * self.__args, - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< - * self.__kwargs, - * self.__kwargs_len) + /* "callables.pxd":39 + * self.__args, + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< + * self.__kwargs, + * self.__kwargs_len) */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 34, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_keyword_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "callables.pxd":38 - * self.__kwargs_len) - * - * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< - * + /* "callables.pxd":43 + * self.__kwargs_len) * + * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_positional_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(3, 38, __pyx_L1_error) + __PYX_ERR(3, 43, __pyx_L1_error) } if (unlikely(__pyx_v_keyword_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(3, 38, __pyx_L1_error) + __PYX_ERR(3, 43, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 38, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("dependency_injector.providers.callables.Callable.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.callables.__call", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_positional_args); @@ -4827,9 +4687,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 99, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 209, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -4942,13 +4802,12 @@ PyMODINIT_FUNC PyInit_factories(void) __pyx_vtabptr_19dependency_injector_9providers_9factories_Factory = &__pyx_vtable_19dependency_injector_9providers_9factories_Factory; __pyx_vtable_19dependency_injector_9providers_9factories_Factory.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_4base_Provider; __pyx_vtable_19dependency_injector_9providers_9factories_Factory.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_4base_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_9factories_7Factory__provide; - __pyx_vtable_19dependency_injector_9providers_9factories_Factory.__pyx___provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *))__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide; __pyx_type_19dependency_injector_9providers_9factories_Factory.tp_base = __pyx_ptype_19dependency_injector_9providers_4base_Provider; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9factories_Factory) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9factories_Factory) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_9factories_Factory.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_Factory, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 20, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_Factory, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 21, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_9factories_7Factory___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_9factories_7Factory___init__.doc = __pyx_doc_19dependency_injector_9providers_9factories_7Factory___init__; @@ -4958,7 +4817,7 @@ PyMODINIT_FUNC PyInit_factories(void) #endif #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_Factory, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 20, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_Factory, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 21, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_9factories_7Factory_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_9factories_7Factory_4__str__.doc = __pyx_doc_19dependency_injector_9providers_9factories_7Factory_4__str__; @@ -4966,16 +4825,16 @@ PyMODINIT_FUNC PyInit_factories(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9factories_Factory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9factories_Factory) < 0) __PYX_ERR(0, 20, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Factory", (PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_Factory) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9factories_Factory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9factories_Factory) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Factory", (PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_Factory) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_9factories_Factory = &__pyx_type_19dependency_injector_9providers_9factories_Factory; __pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory = &__pyx_vtable_19dependency_injector_9providers_9factories_DelegatedFactory; __pyx_vtable_19dependency_injector_9providers_9factories_DelegatedFactory.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_9factories_Factory; __pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory.tp_base = __pyx_ptype_19dependency_injector_9providers_9factories_Factory; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory) < 0) __PYX_ERR(0, 253, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "DelegatedFactory", (PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DelegatedFactory", (PyObject *)&__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory = &__pyx_type_19dependency_injector_9providers_9factories_DelegatedFactory; /*--- Type import code ---*/ __pyx_ptype_19dependency_injector_9providers_4base_Object = __Pyx_ImportType("dependency_injector.providers.base", "Object", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Object), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Object)) __PYX_ERR(4, 15, __pyx_L1_error) @@ -4986,14 +4845,12 @@ PyMODINIT_FUNC PyInit_factories(void) __pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency)) __PYX_ERR(4, 25, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_4base_OverridingContext = __Pyx_ImportType("dependency_injector.providers.base", "OverridingContext", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_OverridingContext)) __PYX_ERR(4, 29, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10injections_Injection = __Pyx_ImportType("dependency_injector.providers.injections", "Injection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = __Pyx_ImportType("dependency_injector.providers.injections", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection = (struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = __Pyx_ImportType("dependency_injector.providers.injections", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 25, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection = (struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = __Pyx_ImportType("dependency_injector.providers.injections", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = __Pyx_ImportType("dependency_injector.providers.injections", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 20, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_9callables_Callable = __Pyx_ImportType("dependency_injector.providers.callables", "Callable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_Callable)) __PYX_ERR(3, 16, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_9callables_Callable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_Callable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable)) __PYX_ERR(3, 16, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = __Pyx_ImportType("dependency_injector.providers.callables", "DelegatedCallable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(3, 41, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(3, 41, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = __Pyx_ImportType("dependency_injector.providers.callables", "DelegatedCallable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(3, 28, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(3, 28, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("dependency_injector.providers.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "CLASS_TYPES", (void **)&__pyx_vp_19dependency_injector_9providers_5utils_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -5032,22 +4889,22 @@ PyMODINIT_FUNC PyInit_factories(void) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/factories.pyx":71 + /* "dependency_injector/providers/factories.pyx":72 * """ * * provided_type = None # <<<<<<<<<<<<<< * * def __init__(self, provides, *args, **kwargs): */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_Factory->tp_dict, __pyx_n_s_provided_type, Py_None) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_Factory->tp_dict, __pyx_n_s_provided_type, Py_None) < 0) __PYX_ERR(0, 72, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_9factories_Factory); - /* "dependency_injector/providers/factories.pyx":271 + /* "dependency_injector/providers/factories.pyx":272 * """ * * __IS_DELEGATED__ = True # <<<<<<<<<<<<<< */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 272, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory); /* "dependency_injector/providers/factories.pyx":1 @@ -5060,12 +4917,12 @@ PyMODINIT_FUNC PyInit_factories(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ /*--- Wrapped vars code ---*/ diff --git a/src/dependency_injector/providers/factories.pxd b/src/dependency_injector/providers/factories.pxd index 89399e17..d8c3b641 100644 --- a/src/dependency_injector/providers/factories.pxd +++ b/src/dependency_injector/providers/factories.pxd @@ -4,7 +4,10 @@ Powered by Cython. """ from .base cimport Provider -from .callables cimport Callable +from .callables cimport ( + Callable, + __call as __call_callable, +) from .injections cimport __inject_attributes @@ -16,18 +19,20 @@ cdef class Factory(Provider): cpdef object _provide(self, tuple args, dict kwargs) - cdef inline object __provide(self, tuple args, dict kwargs): - cdef object instance - - instance = self.__instantiator.__provide(args, kwargs) - - if self.__attributes_len > 0: - __inject_attributes(instance, - self.__attributes, - self.__attributes_len) - - return instance - cdef class DelegatedFactory(Factory): pass + + +cdef inline object __call(Factory self, tuple args, dict kwargs): + cdef object instance + + instance = __call_callable(self.__instantiator, args, kwargs) + + if self.__attributes_len > 0: + __inject_attributes(instance, + self.__attributes, + self.__attributes_len) + + return instance + diff --git a/src/dependency_injector/providers/factories.pyx b/src/dependency_injector/providers/factories.pyx index 8941346f..1c3023a8 100644 --- a/src/dependency_injector/providers/factories.pyx +++ b/src/dependency_injector/providers/factories.pyx @@ -7,6 +7,7 @@ from dependency_injector.errors import Error from .base cimport Provider from .callables cimport Callable +from .factories cimport __call from .injections cimport ( NamedInjection, parse_named_injections, @@ -247,7 +248,7 @@ cdef class Factory(Provider): cpdef object _provide(self, tuple args, dict kwargs): """Return new instance.""" - return self.__provide(args, kwargs) + return __call(self, args, kwargs) cdef class DelegatedFactory(Factory): diff --git a/src/dependency_injector/providers/injections.c b/src/dependency_injector/providers/injections.c index 483d6cfc..bf8e3e4c 100644 --- a/src/dependency_injector/providers/injections.c +++ b/src/dependency_injector/providers/injections.c @@ -639,24 +639,11 @@ struct __pyx_opt_args_19dependency_injector_9providers_5utils_deepcopy { * * * cdef class Injection(object): # <<<<<<<<<<<<<< - * pass - * - */ -struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { - PyObject_HEAD -}; - - -/* "dependency_injector/providers/injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< * cdef object __value * cdef int __is_provider */ -struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { - struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtab; +struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { + PyObject_HEAD PyObject *__pyx___value; int __pyx___is_provider; int __pyx___is_delegated; @@ -664,56 +651,31 @@ struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjecti }; -/* "dependency_injector/providers/injections.pxd":25 +/* "dependency_injector/providers/injections.pxd":16 + * + * + * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; +}; + + +/* "dependency_injector/providers/injections.pxd":20 * * * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< * cdef object __name - * cdef object __value + * */ struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection { struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtab; PyObject *__pyx___name; - PyObject *__pyx___value; - int __pyx___is_provider; - int __pyx___is_delegated; - int __pyx___call; }; - -/* "dependency_injector/providers/injections.pyx":19 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< - * """Positional injection class.""" - * - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection { - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); - - -/* "dependency_injector/providers/injections.pyx":47 - * - * - * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< - * """Keyword injection class.""" - * - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection { - PyObject *(*__pyx___get_name)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY @@ -928,15 +890,6 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* CallNextTpTraverse.proto */ -static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); - -/* CallNextTpClear.proto */ -static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); - -/* SetVTable.proto */ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); - /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -995,9 +948,6 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ /* Module declarations from 'cython' */ @@ -1012,6 +962,8 @@ static PyObject *(*__pyx_f_19dependency_injector_9providers_5utils_deepcopy)(PyO static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_Injection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *); /*proto*/ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(PyObject *, int __pyx_skip_dispatch); /*proto*/ #define __Pyx_MODULE_NAME "dependency_injector.providers.injections" @@ -1032,7 +984,6 @@ static const char __pyx_k_items[] = "items"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_value[] = "value"; -static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_Dependency_injector_injections_P[] = "Dependency injector injections.\n\nPowered by Cython.\n"; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_get; @@ -1041,7 +992,6 @@ static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_super; static PyObject *__pyx_n_s_test; @@ -1062,7 +1012,7 @@ static PyObject *__pyx_tp_new_19dependency_injector_9providers_10injections_Posi static PyObject *__pyx_tp_new_19dependency_injector_9providers_10injections_NamedInjection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0}; -/* "dependency_injector/providers/injections.pyx":22 +/* "dependency_injector/providers/injections.pyx":26 * """Positional injection class.""" * * def __init__(self, value): # <<<<<<<<<<<<<< @@ -1099,7 +1049,7 @@ static int __pyx_pw_19dependency_injector_9providers_10injections_19PositionalIn else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 22, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 26, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1110,7 +1060,7 @@ static int __pyx_pw_19dependency_injector_9providers_10injections_19PositionalIn } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 26, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.injections.PositionalInjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1133,7 +1083,7 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_19PositionalIn PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/injections.pyx":24 + /* "dependency_injector/providers/injections.pyx":28 * def __init__(self, value): * """Initializer.""" * self.__value = value # <<<<<<<<<<<<<< @@ -1142,70 +1092,70 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_19PositionalIn */ __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->__pyx___value); - __Pyx_DECREF(__pyx_v_self->__pyx___value); - __pyx_v_self->__pyx___value = __pyx_v_value; + __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx___value); + __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx___value); + __pyx_v_self->__pyx_base.__pyx___value = __pyx_v_value; - /* "dependency_injector/providers/injections.pyx":25 + /* "dependency_injector/providers/injections.pyx":29 * """Initializer.""" * self.__value = value * self.__is_provider = is_provider(value) # <<<<<<<<<<<<<< * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and */ - __pyx_v_self->__pyx___is_provider = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_provider(__pyx_v_value, 0)); + __pyx_v_self->__pyx_base.__pyx___is_provider = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_provider(__pyx_v_value, 0)); - /* "dependency_injector/providers/injections.pyx":26 + /* "dependency_injector/providers/injections.pyx":30 * self.__value = value * self.__is_provider = is_provider(value) * self.__is_delegated = is_delegated(value) # <<<<<<<<<<<<<< * self.__call = (self.__is_provider == 1 and * self.__is_delegated == 0) */ - __pyx_v_self->__pyx___is_delegated = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_delegated(__pyx_v_value, 0)); + __pyx_v_self->__pyx_base.__pyx___is_delegated = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_delegated(__pyx_v_value, 0)); - /* "dependency_injector/providers/injections.pyx":27 + /* "dependency_injector/providers/injections.pyx":31 * self.__is_provider = is_provider(value) * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and # <<<<<<<<<<<<<< * self.__is_delegated == 0) * super(PositionalInjection, self).__init__() */ - __pyx_t_2 = (__pyx_v_self->__pyx___is_provider == 1); + __pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_provider == 1); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } - /* "dependency_injector/providers/injections.pyx":28 + /* "dependency_injector/providers/injections.pyx":32 * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and * self.__is_delegated == 0) # <<<<<<<<<<<<<< * super(PositionalInjection, self).__init__() * */ - __pyx_t_2 = (__pyx_v_self->__pyx___is_delegated == 0); + __pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_delegated == 0); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; - /* "dependency_injector/providers/injections.pyx":27 + /* "dependency_injector/providers/injections.pyx":31 * self.__is_provider = is_provider(value) * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and # <<<<<<<<<<<<<< * self.__is_delegated == 0) * super(PositionalInjection, self).__init__() */ - __pyx_v_self->__pyx___call = ((int)__pyx_t_1); + __pyx_v_self->__pyx_base.__pyx___call = ((int)__pyx_t_1); - /* "dependency_injector/providers/injections.pyx":29 + /* "dependency_injector/providers/injections.pyx":33 * self.__call = (self.__is_provider == 1 and * self.__is_delegated == 0) * super(PositionalInjection, self).__init__() # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)); @@ -1213,10 +1163,10 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_19PositionalIn __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 33, __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_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -1230,16 +1180,16 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_19PositionalIn } } if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __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; - /* "dependency_injector/providers/injections.pyx":22 + /* "dependency_injector/providers/injections.pyx":26 * """Positional injection class.""" * * def __init__(self, value): # <<<<<<<<<<<<<< @@ -1261,7 +1211,7 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_19PositionalIn return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":31 +/* "dependency_injector/providers/injections.pyx":35 * super(PositionalInjection, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -1297,21 +1247,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi struct __pyx_opt_args_19dependency_injector_9providers_5utils_deepcopy __pyx_t_8; __Pyx_RefNannySetupContext("__deepcopy__", 0); - /* "dependency_injector/providers/injections.pyx":33 + /* "dependency_injector/providers/injections.pyx":37 * def __deepcopy__(self, memo): * """Create and return full copy of provider.""" * copied = memo.get(id(self)) # <<<<<<<<<<<<<< * if copied is not None: * return copied */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -1325,14 +1275,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1341,20 +1291,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -1363,7 +1313,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi __pyx_v_copied = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/injections.pyx":34 + /* "dependency_injector/providers/injections.pyx":38 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1374,7 +1324,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "dependency_injector/providers/injections.pyx":35 + /* "dependency_injector/providers/injections.pyx":39 * copied = memo.get(id(self)) * if copied is not None: * return copied # <<<<<<<<<<<<<< @@ -1386,7 +1336,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":34 + /* "dependency_injector/providers/injections.pyx":38 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1395,7 +1345,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi */ } - /* "dependency_injector/providers/injections.pyx":36 + /* "dependency_injector/providers/injections.pyx":40 * if copied is not None: * return copied * return self.__class__(deepcopy(self.__value, memo)) # <<<<<<<<<<<<<< @@ -1403,14 +1353,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi * def get_value(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_v_self->__pyx___value; + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx___value; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 36, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 40, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -1424,14 +1374,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi } } if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1440,20 +1390,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -1463,7 +1413,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":31 + /* "dependency_injector/providers/injections.pyx":35 * super(PositionalInjection, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -1487,12 +1437,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":38 +/* "dependency_injector/providers/injections.pyx":42 * return self.__class__(deepcopy(self.__value, memo)) * * def get_value(self): # <<<<<<<<<<<<<< * """Return injection value.""" - * return self.__get_value() + * return __get_value(self) */ /* Python wrapper */ @@ -1515,26 +1465,26 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_value", 0); - /* "dependency_injector/providers/injections.pyx":40 + /* "dependency_injector/providers/injections.pyx":44 * def get_value(self): * """Return injection value.""" - * return self.__get_value() # <<<<<<<<<<<<<< + * return __get_value(self) # <<<<<<<<<<<<<< * * def get_original_value(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":38 + /* "dependency_injector/providers/injections.pyx":42 * return self.__class__(deepcopy(self.__value, memo)) * * def get_value(self): # <<<<<<<<<<<<<< * """Return injection value.""" - * return self.__get_value() + * return __get_value(self) */ /* function exit code */ @@ -1548,8 +1498,8 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":42 - * return self.__get_value() +/* "dependency_injector/providers/injections.pyx":46 + * return __get_value(self) * * def get_original_value(self): # <<<<<<<<<<<<<< * """Return original value.""" @@ -1575,7 +1525,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_original_value", 0); - /* "dependency_injector/providers/injections.pyx":44 + /* "dependency_injector/providers/injections.pyx":48 * def get_original_value(self): * """Return original value.""" * return self.__value # <<<<<<<<<<<<<< @@ -1583,12 +1533,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_r = __pyx_v_self->__pyx___value; + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx___value); + __pyx_r = __pyx_v_self->__pyx_base.__pyx___value; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":42 - * return self.__get_value() + /* "dependency_injector/providers/injections.pyx":46 + * return __get_value(self) * * def get_original_value(self): # <<<<<<<<<<<<<< * """Return original value.""" @@ -1602,7 +1552,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_19Positi return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":50 +/* "dependency_injector/providers/injections.pyx":54 * """Keyword injection class.""" * * def __init__(self, name, value): # <<<<<<<<<<<<<< @@ -1642,11 +1592,11 @@ static int __pyx_pw_19dependency_injector_9providers_10injections_14NamedInjecti case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 50, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 54, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 50, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 54, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -1659,7 +1609,7 @@ static int __pyx_pw_19dependency_injector_9providers_10injections_14NamedInjecti } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 54, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.injections.NamedInjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1682,7 +1632,7 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_14NamedInjecti PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/injections.pyx":52 + /* "dependency_injector/providers/injections.pyx":56 * def __init__(self, name, value): * """Initializer.""" * self.__name = name # <<<<<<<<<<<<<< @@ -1695,7 +1645,7 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_14NamedInjecti __Pyx_DECREF(__pyx_v_self->__pyx___name); __pyx_v_self->__pyx___name = __pyx_v_name; - /* "dependency_injector/providers/injections.pyx":53 + /* "dependency_injector/providers/injections.pyx":57 * """Initializer.""" * self.__name = name * self.__value = value # <<<<<<<<<<<<<< @@ -1704,70 +1654,70 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_14NamedInjecti */ __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->__pyx___value); - __Pyx_DECREF(__pyx_v_self->__pyx___value); - __pyx_v_self->__pyx___value = __pyx_v_value; + __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx___value); + __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx___value); + __pyx_v_self->__pyx_base.__pyx___value = __pyx_v_value; - /* "dependency_injector/providers/injections.pyx":54 + /* "dependency_injector/providers/injections.pyx":58 * self.__name = name * self.__value = value * self.__is_provider = is_provider(value) # <<<<<<<<<<<<<< * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and */ - __pyx_v_self->__pyx___is_provider = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_provider(__pyx_v_value, 0)); + __pyx_v_self->__pyx_base.__pyx___is_provider = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_provider(__pyx_v_value, 0)); - /* "dependency_injector/providers/injections.pyx":55 + /* "dependency_injector/providers/injections.pyx":59 * self.__value = value * self.__is_provider = is_provider(value) * self.__is_delegated = is_delegated(value) # <<<<<<<<<<<<<< * self.__call = (self.__is_provider == 1 and * self.__is_delegated == 0) */ - __pyx_v_self->__pyx___is_delegated = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_delegated(__pyx_v_value, 0)); + __pyx_v_self->__pyx_base.__pyx___is_delegated = ((int)__pyx_f_19dependency_injector_9providers_5utils_is_delegated(__pyx_v_value, 0)); - /* "dependency_injector/providers/injections.pyx":56 + /* "dependency_injector/providers/injections.pyx":60 * self.__is_provider = is_provider(value) * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and # <<<<<<<<<<<<<< * self.__is_delegated == 0) * super(NamedInjection, self).__init__() */ - __pyx_t_2 = (__pyx_v_self->__pyx___is_provider == 1); + __pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_provider == 1); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } - /* "dependency_injector/providers/injections.pyx":57 + /* "dependency_injector/providers/injections.pyx":61 * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and * self.__is_delegated == 0) # <<<<<<<<<<<<<< * super(NamedInjection, self).__init__() * */ - __pyx_t_2 = (__pyx_v_self->__pyx___is_delegated == 0); + __pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_delegated == 0); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; - /* "dependency_injector/providers/injections.pyx":56 + /* "dependency_injector/providers/injections.pyx":60 * self.__is_provider = is_provider(value) * self.__is_delegated = is_delegated(value) * self.__call = (self.__is_provider == 1 and # <<<<<<<<<<<<<< * self.__is_delegated == 0) * super(NamedInjection, self).__init__() */ - __pyx_v_self->__pyx___call = ((int)__pyx_t_1); + __pyx_v_self->__pyx_base.__pyx___call = ((int)__pyx_t_1); - /* "dependency_injector/providers/injections.pyx":58 + /* "dependency_injector/providers/injections.pyx":62 * self.__call = (self.__is_provider == 1 and * self.__is_delegated == 0) * super(NamedInjection, self).__init__() # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 58, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)); @@ -1775,10 +1725,10 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_14NamedInjecti __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 58, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 62, __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_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 58, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -1792,16 +1742,16 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_14NamedInjecti } } if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 62, __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; - /* "dependency_injector/providers/injections.pyx":50 + /* "dependency_injector/providers/injections.pyx":54 * """Keyword injection class.""" * * def __init__(self, name, value): # <<<<<<<<<<<<<< @@ -1823,7 +1773,7 @@ static int __pyx_pf_19dependency_injector_9providers_10injections_14NamedInjecti return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":60 +/* "dependency_injector/providers/injections.pyx":64 * super(NamedInjection, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -1861,21 +1811,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("__deepcopy__", 0); - /* "dependency_injector/providers/injections.pyx":62 + /* "dependency_injector/providers/injections.pyx":66 * def __deepcopy__(self, memo): * """Create and return full copy of provider.""" * copied = memo.get(id(self)) # <<<<<<<<<<<<<< * if copied is not None: * return copied */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -1889,14 +1839,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1905,20 +1855,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -1927,7 +1877,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI __pyx_v_copied = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/injections.pyx":63 + /* "dependency_injector/providers/injections.pyx":67 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1938,7 +1888,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "dependency_injector/providers/injections.pyx":64 + /* "dependency_injector/providers/injections.pyx":68 * copied = memo.get(id(self)) * if copied is not None: * return copied # <<<<<<<<<<<<<< @@ -1950,7 +1900,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":63 + /* "dependency_injector/providers/injections.pyx":67 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -1959,7 +1909,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI */ } - /* "dependency_injector/providers/injections.pyx":65 + /* "dependency_injector/providers/injections.pyx":69 * if copied is not None: * return copied * return self.__class__(deepcopy(self.__name, memo), # <<<<<<<<<<<<<< @@ -1967,30 +1917,30 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __pyx_v_self->__pyx___name; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 65, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 69, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pyx":66 + /* "dependency_injector/providers/injections.pyx":70 * return copied * return self.__class__(deepcopy(self.__name, memo), * deepcopy(self.__value, memo)) # <<<<<<<<<<<<<< * * def get_name(self): */ - __pyx_t_5 = __pyx_v_self->__pyx___value; + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx___value; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 66, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 70, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -2008,7 +1958,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2018,7 +1968,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2026,7 +1976,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI } else #endif { - __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -2037,7 +1987,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -2046,7 +1996,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":60 + /* "dependency_injector/providers/injections.pyx":64 * super(NamedInjection, self).__init__() * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -2071,12 +2021,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":68 +/* "dependency_injector/providers/injections.pyx":72 * deepcopy(self.__value, memo)) * * def get_name(self): # <<<<<<<<<<<<<< * """Return injection value.""" - * return self.__get_name() + * return __get_name(self) */ /* Python wrapper */ @@ -2099,26 +2049,26 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_name", 0); - /* "dependency_injector/providers/injections.pyx":70 + /* "dependency_injector/providers/injections.pyx":74 * def get_name(self): * """Return injection value.""" - * return self.__get_name() # <<<<<<<<<<<<<< + * return __get_name(self) # <<<<<<<<<<<<<< * * def get_value(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":68 + /* "dependency_injector/providers/injections.pyx":72 * deepcopy(self.__value, memo)) * * def get_name(self): # <<<<<<<<<<<<<< * """Return injection value.""" - * return self.__get_name() + * return __get_name(self) */ /* function exit code */ @@ -2132,12 +2082,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":72 - * return self.__get_name() +/* "dependency_injector/providers/injections.pyx":76 + * return __get_name(self) * * def get_value(self): # <<<<<<<<<<<<<< * """Return injection value.""" - * return self.__get_value() + * return __get_value(self) */ /* Python wrapper */ @@ -2160,26 +2110,26 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_value", 0); - /* "dependency_injector/providers/injections.pyx":74 + /* "dependency_injector/providers/injections.pyx":78 * def get_value(self): * """Return injection value.""" - * return self.__get_value() # <<<<<<<<<<<<<< + * return __get_value(self) # <<<<<<<<<<<<<< * * def get_original_value(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":72 - * return self.__get_name() + /* "dependency_injector/providers/injections.pyx":76 + * return __get_name(self) * * def get_value(self): # <<<<<<<<<<<<<< * """Return injection value.""" - * return self.__get_value() + * return __get_value(self) */ /* function exit code */ @@ -2193,8 +2143,8 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":76 - * return self.__get_value() +/* "dependency_injector/providers/injections.pyx":80 + * return __get_value(self) * * def get_original_value(self): # <<<<<<<<<<<<<< * """Return original value.""" @@ -2220,7 +2170,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_original_value", 0); - /* "dependency_injector/providers/injections.pyx":78 + /* "dependency_injector/providers/injections.pyx":82 * def get_original_value(self): * """Return original value.""" * return self.__value # <<<<<<<<<<<<<< @@ -2228,12 +2178,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_r = __pyx_v_self->__pyx___value; + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx___value); + __pyx_r = __pyx_v_self->__pyx_base.__pyx___value; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":76 - * return self.__get_value() + /* "dependency_injector/providers/injections.pyx":80 + * return __get_value(self) * * def get_original_value(self): # <<<<<<<<<<<<<< * """Return original value.""" @@ -2247,7 +2197,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_14NamedI return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":83 +/* "dependency_injector/providers/injections.pyx":87 * @cython.boundscheck(False) * @cython.wraparound(False) * cpdef tuple parse_positional_injections(tuple args): # <<<<<<<<<<<<<< @@ -2272,19 +2222,19 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_pos int __pyx_t_6; __Pyx_RefNannySetupContext("parse_positional_injections", 0); - /* "dependency_injector/providers/injections.pyx":85 + /* "dependency_injector/providers/injections.pyx":89 * cpdef tuple parse_positional_injections(tuple args): * """Parse positional injections.""" * cdef list injections = list() # <<<<<<<<<<<<<< * cdef int args_len = len(args) * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_injections = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/injections.pyx":86 + /* "dependency_injector/providers/injections.pyx":90 * """Parse positional injections.""" * cdef list injections = list() * cdef int args_len = len(args) # <<<<<<<<<<<<<< @@ -2293,12 +2243,12 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_pos */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 86, __pyx_L1_error) + __PYX_ERR(1, 90, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 86, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 90, __pyx_L1_error) __pyx_v_args_len = __pyx_t_2; - /* "dependency_injector/providers/injections.pyx":92 + /* "dependency_injector/providers/injections.pyx":96 * cdef PositionalInjection injection * * for index in range(args_len): # <<<<<<<<<<<<<< @@ -2309,7 +2259,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_pos for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "dependency_injector/providers/injections.pyx":93 + /* "dependency_injector/providers/injections.pyx":97 * * for index in range(args_len): * arg = args[index] # <<<<<<<<<<<<<< @@ -2318,42 +2268,42 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_pos */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 93, __pyx_L1_error) + __PYX_ERR(1, 97, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_args, __pyx_v_index); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/injections.pyx":94 + /* "dependency_injector/providers/injections.pyx":98 * for index in range(args_len): * arg = args[index] * injection = PositionalInjection(arg) # <<<<<<<<<<<<<< * injections.append(injection) * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_arg); __Pyx_GIVEREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arg); - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pyx":95 + /* "dependency_injector/providers/injections.pyx":99 * arg = args[index] * injection = PositionalInjection(arg) * injections.append(injection) # <<<<<<<<<<<<<< * * return tuple(injections) */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_injections, ((PyObject *)__pyx_v_injection)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 95, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_injections, ((PyObject *)__pyx_v_injection)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 99, __pyx_L1_error) } - /* "dependency_injector/providers/injections.pyx":97 + /* "dependency_injector/providers/injections.pyx":101 * injections.append(injection) * * return tuple(injections) # <<<<<<<<<<<<<< @@ -2361,13 +2311,13 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_pos * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyList_AsTuple(__pyx_v_injections); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 97, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(__pyx_v_injections); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":83 + /* "dependency_injector/providers/injections.pyx":87 * @cython.boundscheck(False) * @cython.wraparound(False) * cpdef tuple parse_positional_injections(tuple args): # <<<<<<<<<<<<<< @@ -2397,7 +2347,7 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10injections_1parse_p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_positional_injections (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 87, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_self, ((PyObject*)__pyx_v_args)); /* function exit code */ @@ -2415,7 +2365,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_parse_po PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("parse_positional_injections", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2432,7 +2382,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_parse_po return __pyx_r; } -/* "dependency_injector/providers/injections.pyx":102 +/* "dependency_injector/providers/injections.pyx":106 * @cython.boundscheck(False) * @cython.wraparound(False) * cpdef tuple parse_named_injections(dict kwargs): # <<<<<<<<<<<<<< @@ -2459,19 +2409,19 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam int __pyx_t_9; __Pyx_RefNannySetupContext("parse_named_injections", 0); - /* "dependency_injector/providers/injections.pyx":104 + /* "dependency_injector/providers/injections.pyx":108 * cpdef tuple parse_named_injections(dict kwargs): * """Parse named injections.""" * cdef list injections = list() # <<<<<<<<<<<<<< * * cdef object name */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_injections = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/injections.pyx":110 + /* "dependency_injector/providers/injections.pyx":114 * cdef NamedInjection injection * * for name, arg in kwargs.items(): # <<<<<<<<<<<<<< @@ -2480,17 +2430,17 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items"); - __PYX_ERR(1, 110, __pyx_L1_error) + __PYX_ERR(1, 114, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __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_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 114, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -2498,17 +2448,17 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) 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(1, 110, __pyx_L1_error) + __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(1, 114, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) 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(1, 110, __pyx_L1_error) + __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(1, 114, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -2518,7 +2468,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(1, 110, __pyx_L1_error) + else __PYX_ERR(1, 114, __pyx_L1_error) } break; } @@ -2534,7 +2484,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 110, __pyx_L1_error) + __PYX_ERR(1, 114, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -2547,15 +2497,15 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -2563,7 +2513,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 110, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 114, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -2571,7 +2521,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(1, 110, __pyx_L1_error) + __PYX_ERR(1, 114, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); @@ -2579,14 +2529,14 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/providers/injections.pyx":111 + /* "dependency_injector/providers/injections.pyx":115 * * for name, arg in kwargs.items(): * injection = NamedInjection(name, arg) # <<<<<<<<<<<<<< * injections.append(injection) * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 111, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); @@ -2594,22 +2544,22 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam __Pyx_INCREF(__pyx_v_arg); __Pyx_GIVEREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_arg); - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 111, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_6)); __pyx_t_6 = 0; - /* "dependency_injector/providers/injections.pyx":112 + /* "dependency_injector/providers/injections.pyx":116 * for name, arg in kwargs.items(): * injection = NamedInjection(name, arg) * injections.append(injection) # <<<<<<<<<<<<<< * * return tuple(injections) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_injections, ((PyObject *)__pyx_v_injection)); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 112, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_injections, ((PyObject *)__pyx_v_injection)); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 116, __pyx_L1_error) - /* "dependency_injector/providers/injections.pyx":110 + /* "dependency_injector/providers/injections.pyx":114 * cdef NamedInjection injection * * for name, arg in kwargs.items(): # <<<<<<<<<<<<<< @@ -2619,19 +2569,19 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10injections_parse_nam } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/injections.pyx":114 + /* "dependency_injector/providers/injections.pyx":118 * injections.append(injection) * * return tuple(injections) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_AsTuple(__pyx_v_injections); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(__pyx_v_injections); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pyx":102 + /* "dependency_injector/providers/injections.pyx":106 * @cython.boundscheck(False) * @cython.wraparound(False) * cpdef tuple parse_named_injections(dict kwargs): # <<<<<<<<<<<<<< @@ -2665,7 +2615,7 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10injections_3parse_n PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_named_injections (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 102, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 106, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_10injections_2parse_named_injections(__pyx_self, ((PyObject*)__pyx_v_kwargs)); /* function exit code */ @@ -2683,7 +2633,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_2parse_n PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("parse_named_injections", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2700,136 +2650,36 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10injections_2parse_n return __pyx_r; } -/* "dependency_injector/providers/injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__get_value", 0); - - /* "dependency_injector/providers/injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); - if (__pyx_t_1) { - - /* "dependency_injector/providers/injections.pxd":21 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_r = __pyx_v_self->__pyx___value; - goto __pyx_L0; - - /* "dependency_injector/providers/injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - } - - /* "dependency_injector/providers/injections.pxd":22 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< +/* "dependency_injector/providers/injections.pxd":24 * * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_t_3 = __pyx_v_self->__pyx___value; __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && 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); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "dependency_injector/providers/injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.PositionalInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/providers/injections.pxd":32 - * cdef int __call - * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get_name", 0); - /* "dependency_injector/providers/injections.pxd":33 + /* "dependency_injector/providers/injections.pxd":25 + * + * cdef inline object __get_name(NamedInjection self): + * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_name(self): - * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_value(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx___name); __pyx_r = __pyx_v_self->__pyx___name; goto __pyx_L0; - /* "dependency_injector/providers/injections.pxd":32 - * cdef int __call + /* "dependency_injector/providers/injections.pxd":24 * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ @@ -2840,15 +2690,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "dependency_injector/providers/injections.pxd":35 - * return self.__name +/* "dependency_injector/providers/injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -2857,21 +2707,21 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get_value", 0); - /* "dependency_injector/providers/injections.pxd":36 + /* "dependency_injector/providers/injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); if (__pyx_t_1) { - /* "dependency_injector/providers/injections.pxd":37 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() + /* "dependency_injector/providers/injections.pxd":30 + * cdef inline object __get_value(Injection self): + * if self.__call == 0: + * return self.__value # <<<<<<<<<<<<<< + * return self.__value() * */ __Pyx_XDECREF(__pyx_r); @@ -2879,19 +2729,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_self->__pyx___value; goto __pyx_L0; - /* "dependency_injector/providers/injections.pxd":36 + /* "dependency_injector/providers/injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ } - /* "dependency_injector/providers/injections.pxd":38 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< + /* "dependency_injector/providers/injections.pxd":31 + * if self.__call == 0: + * return self.__value + * return self.__value() # <<<<<<<<<<<<<< * * */ @@ -2908,10 +2758,10 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -2919,12 +2769,12 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pxd":35 - * return self.__name + /* "dependency_injector/providers/injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ /* function exit code */ @@ -2932,7 +2782,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.NamedInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.injections.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2940,7 +2790,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "dependency_injector/providers/injections.pxd":43 +/* "dependency_injector/providers/injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -2961,7 +2811,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__provide_positional_args", 0); - /* "dependency_injector/providers/injections.pxd":50 + /* "dependency_injector/providers/injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -2971,7 +2821,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0); if (__pyx_t_1) { - /* "dependency_injector/providers/injections.pxd":51 + /* "dependency_injector/providers/injections.pxd":44 * * if inj_args_len == 0: * return args # <<<<<<<<<<<<<< @@ -2983,7 +2833,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_args; goto __pyx_L0; - /* "dependency_injector/providers/injections.pxd":50 + /* "dependency_injector/providers/injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -2992,68 +2842,68 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ } - /* "dependency_injector/providers/injections.pxd":53 + /* "dependency_injector/providers/injections.pxd":46 * return args * * positional_args = list() # <<<<<<<<<<<<<< * for index in range(inj_args_len): * injection = inj_args[index] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/injections.pxd":54 + /* "dependency_injector/providers/injections.pxd":47 * * positional_args = list() * for index in range(inj_args_len): # <<<<<<<<<<<<<< * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) */ __pyx_t_3 = __pyx_v_inj_args_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "dependency_injector/providers/injections.pxd":55 + /* "dependency_injector/providers/injections.pxd":48 * positional_args = list() * for index in range(inj_args_len): * injection = inj_args[index] # <<<<<<<<<<<<<< - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) */ if (unlikely(__pyx_v_inj_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 55, __pyx_L1_error) + __PYX_ERR(0, 48, __pyx_L1_error) } __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)__pyx_t_2)); __pyx_t_2 = 0; - /* "dependency_injector/providers/injections.pxd":56 + /* "dependency_injector/providers/injections.pxd":49 * for index in range(inj_args_len): * injection = inj_args[index] - * positional_args.append(injection.__get_value()) # <<<<<<<<<<<<<< + * positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<< * positional_args.extend(args) * */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(__pyx_v_injection); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "dependency_injector/providers/injections.pxd":57 + /* "dependency_injector/providers/injections.pxd":50 * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) # <<<<<<<<<<<<<< * * return tuple(positional_args) */ - __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 50, __pyx_L1_error) - /* "dependency_injector/providers/injections.pxd":59 + /* "dependency_injector/providers/injections.pxd":52 * positional_args.extend(args) * * return tuple(positional_args) # <<<<<<<<<<<<<< @@ -3061,13 +2911,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/providers/injections.pxd":43 + /* "dependency_injector/providers/injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -3088,7 +2938,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "dependency_injector/providers/injections.pxd":64 +/* "dependency_injector/providers/injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -3110,7 +2960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_6; __Pyx_RefNannySetupContext("__provide_keyword_args", 0); - /* "dependency_injector/providers/injections.pxd":71 + /* "dependency_injector/providers/injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -3119,69 +2969,69 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 71, __pyx_L1_error) + __PYX_ERR(0, 64, __pyx_L1_error) } - __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 64, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "dependency_injector/providers/injections.pxd":72 + /* "dependency_injector/providers/injections.pxd":65 * * if len(kwargs) == 0: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "dependency_injector/providers/injections.pxd":73 + /* "dependency_injector/providers/injections.pxd":66 * if len(kwargs) == 0: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 73, __pyx_L1_error) + __PYX_ERR(0, 66, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pxd":74 + /* "dependency_injector/providers/injections.pxd":67 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) * else: */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pxd":75 + /* "dependency_injector/providers/injections.pxd":68 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * else: * for index in range(inj_kwargs_len): */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 75, __pyx_L1_error) + __PYX_ERR(0, 68, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 75, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - /* "dependency_injector/providers/injections.pxd":71 + /* "dependency_injector/providers/injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -3191,82 +3041,82 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject goto __pyx_L3; } - /* "dependency_injector/providers/injections.pxd":77 - * kwargs[name] = kw_injection.__get_value() + /* "dependency_injector/providers/injections.pxd":70 + * kwargs[name] = __get_value(kw_injection) * else: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ /*else*/ { __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "dependency_injector/providers/injections.pxd":78 + /* "dependency_injector/providers/injections.pxd":71 * else: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 78, __pyx_L1_error) + __PYX_ERR(0, 71, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pxd":79 + /* "dependency_injector/providers/injections.pxd":72 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pxd":80 + /* "dependency_injector/providers/injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 80, __pyx_L1_error) + __PYX_ERR(0, 73, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { - /* "dependency_injector/providers/injections.pxd":81 - * name = kw_injection.__get_name() + /* "dependency_injector/providers/injections.pxd":74 + * name = __get_name(kw_injection) * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * * return kwargs */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 81, __pyx_L1_error) + __PYX_ERR(0, 74, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/providers/injections.pxd":80 + /* "dependency_injector/providers/injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ } @@ -3274,8 +3124,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } __pyx_L3:; - /* "dependency_injector/providers/injections.pxd":83 - * kwargs[name] = kw_injection.__get_value() + /* "dependency_injector/providers/injections.pxd":76 + * kwargs[name] = __get_value(kw_injection) * * return kwargs # <<<<<<<<<<<<<< * @@ -3286,7 +3136,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_kwargs; goto __pyx_L0; - /* "dependency_injector/providers/injections.pxd":64 + /* "dependency_injector/providers/injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -3307,7 +3157,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "dependency_injector/providers/injections.pxd":88 +/* "dependency_injector/providers/injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -3327,7 +3177,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__inject_attributes", 0); - /* "dependency_injector/providers/injections.pxd":92 + /* "dependency_injector/providers/injections.pxd":85 * int attributes_len): * cdef NamedInjection attr_injection * for index in range(attributes_len): # <<<<<<<<<<<<<< @@ -3338,55 +3188,55 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_index = __pyx_t_2; - /* "dependency_injector/providers/injections.pxd":93 + /* "dependency_injector/providers/injections.pxd":86 * cdef NamedInjection attr_injection * for index in range(attributes_len): * attr_injection = attributes[index] # <<<<<<<<<<<<<< * setattr(instance, - * attr_injection.__get_name(), + * __get_name(attr_injection), */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 93, __pyx_L1_error) + __PYX_ERR(0, 86, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index); __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_3)); __pyx_t_3 = 0; - /* "dependency_injector/providers/injections.pxd":95 + /* "dependency_injector/providers/injections.pxd":88 * attr_injection = attributes[index] * setattr(instance, - * attr_injection.__get_name(), # <<<<<<<<<<<<<< - * attr_injection.__get_value()) + * __get_name(attr_injection), # <<<<<<<<<<<<<< + * __get_value(attr_injection)) * */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "dependency_injector/providers/injections.pxd":96 + /* "dependency_injector/providers/injections.pxd":89 * setattr(instance, - * attr_injection.__get_name(), - * attr_injection.__get_value()) # <<<<<<<<<<<<<< + * __get_name(attr_injection), + * __get_value(attr_injection)) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_attr_injection); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "dependency_injector/providers/injections.pxd":94 + /* "dependency_injector/providers/injections.pxd":87 * for index in range(attributes_len): * attr_injection = attributes[index] * setattr(instance, # <<<<<<<<<<<<<< - * attr_injection.__get_name(), - * attr_injection.__get_value()) + * __get_name(attr_injection), + * __get_value(attr_injection)) */ - __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "dependency_injector/providers/injections.pxd":88 + /* "dependency_injector/providers/injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -3410,6 +3260,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } static PyObject *__pyx_tp_new_19dependency_injector_9providers_10injections_Injection(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); @@ -3417,18 +3268,41 @@ static PyObject *__pyx_tp_new_19dependency_injector_9providers_10injections_Inje o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)o); + p->__pyx___value = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_19dependency_injector_9providers_10injections_Injection(PyObject *o) { + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx___value); (*Py_TYPE(o)->tp_free)(o); } +static int __pyx_tp_traverse_19dependency_injector_9providers_10injections_Injection(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)o; + if (p->__pyx___value) { + e = (*v)(p->__pyx___value, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_19dependency_injector_9providers_10injections_Injection(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)o; + tmp = ((PyObject*)p->__pyx___value); + p->__pyx___value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + static PyTypeObject __pyx_type_19dependency_injector_9providers_10injections_Injection = { PyVarObject_HEAD_INIT(0, 0) "dependency_injector.providers.injections.Injection", /*tp_name*/ @@ -3454,10 +3328,10 @@ static PyTypeObject __pyx_type_19dependency_injector_9providers_10injections_Inj 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_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Abstract injection class.", /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_19dependency_injector_9providers_10injections_Injection, /*tp_traverse*/ + __pyx_tp_clear_19dependency_injector_9providers_10injections_Injection, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -3486,54 +3360,13 @@ static PyTypeObject __pyx_type_19dependency_injector_9providers_10injections_Inj 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection __pyx_vtable_19dependency_injector_9providers_10injections_PositionalInjection; static PyObject *__pyx_tp_new_19dependency_injector_9providers_10injections_PositionalInjection(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *p; PyObject *o = __pyx_tp_new_19dependency_injector_9providers_10injections_Injection(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)o); - p->__pyx_vtab = __pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection; - p->__pyx___value = Py_None; Py_INCREF(Py_None); return o; } -static void __pyx_tp_dealloc_19dependency_injector_9providers_10injections_PositionalInjection(PyObject *o) { - struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx___value); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) - #endif - PyObject_GC_Track(o); - __pyx_tp_dealloc_19dependency_injector_9providers_10injections_Injection(o); -} - -static int __pyx_tp_traverse_19dependency_injector_9providers_10injections_PositionalInjection(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)o; - e = ((likely(__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) ? ((__pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_traverse) ? __pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_19dependency_injector_9providers_10injections_PositionalInjection)); if (e) return e; - if (p->__pyx___value) { - e = (*v)(p->__pyx___value, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_19dependency_injector_9providers_10injections_PositionalInjection(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)o; - if (likely(__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) { if (__pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_clear) __pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_19dependency_injector_9providers_10injections_PositionalInjection); - tmp = ((PyObject*)p->__pyx___value); - p->__pyx___value = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - static PyMethodDef __pyx_methods_19dependency_injector_9providers_10injections_PositionalInjection[] = { {"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_10injections_19PositionalInjection_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_10injections_19PositionalInjection_2__deepcopy__}, {"get_value", (PyCFunction)__pyx_pw_19dependency_injector_9providers_10injections_19PositionalInjection_5get_value, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_10injections_19PositionalInjection_4get_value}, @@ -3546,7 +3379,7 @@ static PyTypeObject __pyx_type_19dependency_injector_9providers_10injections_Pos "dependency_injector.providers.injections.PositionalInjection", /*tp_name*/ sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_9providers_10injections_PositionalInjection, /*tp_dealloc*/ + __pyx_tp_dealloc_19dependency_injector_9providers_10injections_Injection, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -3568,8 +3401,8 @@ static PyTypeObject __pyx_type_19dependency_injector_9providers_10injections_Pos 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Positional injection class.", /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_9providers_10injections_PositionalInjection, /*tp_traverse*/ - __pyx_tp_clear_19dependency_injector_9providers_10injections_PositionalInjection, /*tp_clear*/ + __pyx_tp_traverse_19dependency_injector_9providers_10injections_Injection, /*tp_traverse*/ + __pyx_tp_clear_19dependency_injector_9providers_10injections_Injection, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -3598,16 +3431,13 @@ static PyTypeObject __pyx_type_19dependency_injector_9providers_10injections_Pos 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection __pyx_vtable_19dependency_injector_9providers_10injections_NamedInjection; static PyObject *__pyx_tp_new_19dependency_injector_9providers_10injections_NamedInjection(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *p; PyObject *o = __pyx_tp_new_19dependency_injector_9providers_10injections_Injection(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)o); - p->__pyx_vtab = __pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection; p->__pyx___name = Py_None; Py_INCREF(Py_None); - p->__pyx___value = Py_None; Py_INCREF(Py_None); return o; } @@ -3620,10 +3450,6 @@ static void __pyx_tp_dealloc_19dependency_injector_9providers_10injections_Named #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx___name); - Py_CLEAR(p->__pyx___value); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) - #endif PyObject_GC_Track(o); __pyx_tp_dealloc_19dependency_injector_9providers_10injections_Injection(o); } @@ -3631,26 +3457,20 @@ static void __pyx_tp_dealloc_19dependency_injector_9providers_10injections_Named static int __pyx_tp_traverse_19dependency_injector_9providers_10injections_NamedInjection(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)o; - e = ((likely(__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) ? ((__pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_traverse) ? __pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_19dependency_injector_9providers_10injections_NamedInjection)); if (e) return e; + e = __pyx_tp_traverse_19dependency_injector_9providers_10injections_Injection(o, v, a); if (e) return e; if (p->__pyx___name) { e = (*v)(p->__pyx___name, a); if (e) return e; } - if (p->__pyx___value) { - e = (*v)(p->__pyx___value, a); if (e) return e; - } return 0; } static int __pyx_tp_clear_19dependency_injector_9providers_10injections_NamedInjection(PyObject *o) { PyObject* tmp; struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *p = (struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)o; - if (likely(__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) { if (__pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_clear) __pyx_ptype_19dependency_injector_9providers_10injections_Injection->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_19dependency_injector_9providers_10injections_NamedInjection); + __pyx_tp_clear_19dependency_injector_9providers_10injections_Injection(o); tmp = ((PyObject*)p->__pyx___name); p->__pyx___name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx___value); - p->__pyx___value = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); return 0; } @@ -3752,7 +3572,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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}, @@ -3760,9 +3579,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 29, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 33, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 37, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -3871,18 +3690,16 @@ PyMODINIT_FUNC PyInit_injections(void) if (__Pyx_ExportFunction("parse_positional_injections", (void (*)(void))__pyx_f_19dependency_injector_9providers_10injections_parse_positional_injections, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) if (__Pyx_ExportFunction("parse_named_injections", (void (*)(void))__pyx_f_19dependency_injector_9providers_10injections_parse_named_injections, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10injections_Injection) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10injections_Injection) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10injections_Injection.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Injection", (PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_Injection) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Injection", (PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_Injection) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10injections_Injection = &__pyx_type_19dependency_injector_9providers_10injections_Injection; - __pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection = &__pyx_vtable_19dependency_injector_9providers_10injections_PositionalInjection; - __pyx_vtable_19dependency_injector_9providers_10injections_PositionalInjection.__pyx___get_value = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *))__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value; __pyx_type_19dependency_injector_9providers_10injections_PositionalInjection.tp_base = __pyx_ptype_19dependency_injector_9providers_10injections_Injection; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection) < 0) __PYX_ERR(1, 19, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10injections_PositionalInjection.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 19, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 23, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10injections_19PositionalInjection___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10injections_19PositionalInjection___init__.doc = __pyx_doc_19dependency_injector_9providers_10injections_19PositionalInjection___init__; @@ -3890,18 +3707,14 @@ PyMODINIT_FUNC PyInit_injections(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection) < 0) __PYX_ERR(1, 19, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "PositionalInjection", (PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection) < 0) __PYX_ERR(1, 19, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "PositionalInjection", (PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = &__pyx_type_19dependency_injector_9providers_10injections_PositionalInjection; - __pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection = &__pyx_vtable_19dependency_injector_9providers_10injections_NamedInjection; - __pyx_vtable_19dependency_injector_9providers_10injections_NamedInjection.__pyx___get_name = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *))__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name; - __pyx_vtable_19dependency_injector_9providers_10injections_NamedInjection.__pyx___get_value = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *))__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value; __pyx_type_19dependency_injector_9providers_10injections_NamedInjection.tp_base = __pyx_ptype_19dependency_injector_9providers_10injections_Injection; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10injections_NamedInjection) < 0) __PYX_ERR(1, 47, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10injections_NamedInjection) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10injections_NamedInjection.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_NamedInjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 47, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_NamedInjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 51, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10injections_14NamedInjection___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10injections_14NamedInjection___init__.doc = __pyx_doc_19dependency_injector_9providers_10injections_14NamedInjection___init__; @@ -3909,8 +3722,7 @@ PyMODINIT_FUNC PyInit_injections(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10injections_NamedInjection.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection) < 0) __PYX_ERR(1, 47, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "NamedInjection", (PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_NamedInjection) < 0) __PYX_ERR(1, 47, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NamedInjection", (PyObject *)&__pyx_type_19dependency_injector_9providers_10injections_NamedInjection) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = &__pyx_type_19dependency_injector_9providers_10injections_NamedInjection; /*--- Type import code ---*/ /*--- Variable import code ---*/ @@ -3938,7 +3750,7 @@ PyMODINIT_FUNC PyInit_injections(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/injections.pxd":88 + /* "dependency_injector/providers/injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -4523,47 +4335,6 @@ bad: return 0; } -/* CallNextTpTraverse */ - static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { - PyTypeObject* type = Py_TYPE(obj); - while (type && type->tp_traverse != current_tp_traverse) - type = type->tp_base; - while (type && type->tp_traverse == current_tp_traverse) - type = type->tp_base; - if (type && type->tp_traverse) - return type->tp_traverse(obj, v, a); - return 0; -} - -/* CallNextTpClear */ - static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { - PyTypeObject* type = Py_TYPE(obj); - while (type && type->tp_clear != current_tp_clear) - type = type->tp_base; - while (type && type->tp_clear == current_tp_clear) - type = type->tp_base; - if (type && type->tp_clear) - type->tp_clear(obj); -} - -/* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; diff --git a/src/dependency_injector/providers/injections.pxd b/src/dependency_injector/providers/injections.pxd index dcf1ef93..c1de96ee 100644 --- a/src/dependency_injector/providers/injections.pxd +++ b/src/dependency_injector/providers/injections.pxd @@ -7,35 +7,28 @@ cimport cython cdef class Injection(object): - pass - - -cdef class PositionalInjection(Injection): cdef object __value cdef int __is_provider cdef int __is_delegated cdef int __call - cdef inline object __get_value(self): - if self.__call == 0: - return self.__value - return self.__value() + +cdef class PositionalInjection(Injection): + pass cdef class NamedInjection(Injection): cdef object __name - cdef object __value - cdef int __is_provider - cdef int __is_delegated - cdef int __call - cdef inline object __get_name(self): - return self.__name - cdef inline object __get_value(self): - if self.__call == 0: - return self.__value - return self.__value() +cdef inline object __get_name(NamedInjection self): + return self.__name + + +cdef inline object __get_value(Injection self): + if self.__call == 0: + return self.__value + return self.__value() @cython.boundscheck(False) @@ -53,7 +46,7 @@ cdef inline tuple __provide_positional_args(tuple args, positional_args = list() for index in range(inj_args_len): injection = inj_args[index] - positional_args.append(injection.__get_value()) + positional_args.append(__get_value(injection)) positional_args.extend(args) return tuple(positional_args) @@ -71,14 +64,14 @@ cdef inline dict __provide_keyword_args(dict kwargs, if len(kwargs) == 0: for index in range(inj_kwargs_len): kw_injection = inj_kwargs[index] - name = kw_injection.__get_name() - kwargs[name] = kw_injection.__get_value() + name = __get_name(kw_injection) + kwargs[name] = __get_value(kw_injection) else: for index in range(inj_kwargs_len): kw_injection = inj_kwargs[index] - name = kw_injection.__get_name() + name = __get_name(kw_injection) if name not in kwargs: - kwargs[name] = kw_injection.__get_value() + kwargs[name] = __get_value(kw_injection) return kwargs @@ -92,8 +85,8 @@ cdef inline object __inject_attributes(object instance, for index in range(attributes_len): attr_injection = attributes[index] setattr(instance, - attr_injection.__get_name(), - attr_injection.__get_value()) + __get_name(attr_injection), + __get_value(attr_injection)) cpdef tuple parse_positional_injections(tuple args) diff --git a/src/dependency_injector/providers/injections.pyx b/src/dependency_injector/providers/injections.pyx index 41248901..86dd1477 100644 --- a/src/dependency_injector/providers/injections.pyx +++ b/src/dependency_injector/providers/injections.pyx @@ -5,6 +5,10 @@ Powered by Cython. cimport cython +from .injections cimport ( + __get_name, + __get_value, +) from .utils cimport ( is_provider, is_delegated, @@ -37,7 +41,7 @@ cdef class PositionalInjection(Injection): def get_value(self): """Return injection value.""" - return self.__get_value() + return __get_value(self) def get_original_value(self): """Return original value.""" @@ -67,11 +71,11 @@ cdef class NamedInjection(Injection): def get_name(self): """Return injection value.""" - return self.__get_name() + return __get_name(self) def get_value(self): """Return injection value.""" - return self.__get_value() + return __get_value(self) def get_original_value(self): """Return original value.""" diff --git a/src/dependency_injector/providers/singletons.c b/src/dependency_injector/providers/singletons.c index 36908d35..295033c8 100644 --- a/src/dependency_injector/providers/singletons.c +++ b/src/dependency_injector/providers/singletons.c @@ -615,7 +615,6 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { - "src/dependency_injector/providers/singletons.pxd", "src/dependency_injector/providers/singletons.pyx", "src/dependency_injector/providers/injections.pxd", "src/dependency_injector/providers/callables.pxd", @@ -726,24 +725,11 @@ struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext { * * * cdef class Injection(object): # <<<<<<<<<<<<<< - * pass - * - */ -struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { - PyObject_HEAD -}; - - -/* "injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< * cdef object __value * cdef int __is_provider */ -struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { - struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtab; +struct __pyx_obj_19dependency_injector_9providers_10injections_Injection { + PyObject_HEAD PyObject *__pyx___value; int __pyx___is_provider; int __pyx___is_delegated; @@ -751,21 +737,28 @@ struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjecti }; -/* "injections.pxd":25 +/* "injections.pxd":16 + * + * + * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection { + struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; +}; + + +/* "injections.pxd":20 * * * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< * cdef object __name - * cdef object __value + * */ struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection { struct __pyx_obj_19dependency_injector_9providers_10injections_Injection __pyx_base; - struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtab; PyObject *__pyx___name; - PyObject *__pyx___value; - int __pyx___is_provider; - int __pyx___is_delegated; - int __pyx___call; }; @@ -786,18 +779,19 @@ struct __pyx_obj_19dependency_injector_9providers_9callables_Callable { }; -/* "callables.pxd":41 +/* "callables.pxd":28 * * * cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable { struct __pyx_obj_19dependency_injector_9providers_9callables_Callable __pyx_base; }; -/* "factories.pxd":11 +/* "factories.pxd":14 * * * cdef class Factory(Provider): # <<<<<<<<<<<<<< @@ -812,11 +806,12 @@ struct __pyx_obj_19dependency_injector_9providers_9factories_Factory { }; -/* "factories.pxd":32 +/* "factories.pxd":23 * * * cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_obj_19dependency_injector_9providers_9factories_DelegatedFactory { struct __pyx_obj_19dependency_injector_9providers_9factories_Factory __pyx_base; @@ -849,7 +844,7 @@ struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton { }; -/* "dependency_injector/providers/singletons.pxd":25 +/* "dependency_injector/providers/singletons.pxd":20 * * * cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<< @@ -861,7 +856,7 @@ struct __pyx_obj_19dependency_injector_9providers_10singletons_DelegatedSingleto }; -/* "dependency_injector/providers/singletons.pxd":29 +/* "dependency_injector/providers/singletons.pxd":24 * * * cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<< @@ -875,7 +870,7 @@ struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSinglet }; -/* "dependency_injector/providers/singletons.pxd":42 +/* "dependency_injector/providers/singletons.pxd":31 * * * cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<< @@ -887,7 +882,7 @@ struct __pyx_obj_19dependency_injector_9providers_10singletons_DelegatedThreadSa }; -/* "dependency_injector/providers/singletons.pxd":46 +/* "dependency_injector/providers/singletons.pxd":35 * * * cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<< @@ -900,7 +895,7 @@ struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingle }; -/* "dependency_injector/providers/singletons.pxd":63 +/* "dependency_injector/providers/singletons.pxd":41 * * * cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<< @@ -969,38 +964,6 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependenc static struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency *__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency; -/* "injections.pxd":13 - * - * - * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< - * cdef object __value - * cdef int __is_provider - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection { - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *); - - -/* "injections.pxd":25 - * - * - * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< - * cdef object __name - * cdef object __value - */ - -struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection { - PyObject *(*__pyx___get_name)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - PyObject *(*__pyx___get_value)(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -}; -static struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection *__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); - - /* "callables.pxd":16 * * @@ -1011,17 +974,16 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable { struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable *__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); -/* "callables.pxd":41 +/* "callables.pxd":28 * * * cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable { @@ -1030,7 +992,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCal static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable *__pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable; -/* "factories.pxd":11 +/* "factories.pxd":14 * * * cdef class Factory(Provider): # <<<<<<<<<<<<<< @@ -1040,17 +1002,16 @@ static struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Deleg struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_Factory { struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_Factory *__pyx_vtabptr_19dependency_injector_9providers_9factories_Factory; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *); -/* "factories.pxd":32 +/* "factories.pxd":23 * * * cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<< * pass + * */ struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_DelegatedFactory { @@ -1059,7 +1020,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_DelegatedFac static struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_DelegatedFactory *__pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory; -/* "dependency_injector/providers/singletons.pyx":25 +/* "dependency_injector/providers/singletons.pyx":28 * * * cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<< @@ -1073,7 +1034,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_BaseSingle static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_BaseSingleton *__pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton; -/* "dependency_injector/providers/singletons.pyx":199 +/* "dependency_injector/providers/singletons.pyx":202 * * * cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<< @@ -1083,13 +1044,11 @@ static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_Bas struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_Singleton { struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_BaseSingleton __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_Singleton *__pyx_vtabptr_19dependency_injector_9providers_10singletons_Singleton; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *, PyObject *, PyObject *); -/* "dependency_injector/providers/singletons.pyx":257 +/* "dependency_injector/providers/singletons.pyx":263 * * * cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<< @@ -1103,7 +1062,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_DelegatedS static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_DelegatedSingleton *__pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedSingleton; -/* "dependency_injector/providers/singletons.pyx":278 +/* "dependency_injector/providers/singletons.pyx":284 * * * cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<< @@ -1113,13 +1072,11 @@ static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_Del struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_ThreadSafeSingleton { struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_BaseSingleton __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadSafeSingleton; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *, PyObject *, PyObject *); -/* "dependency_injector/providers/singletons.pyx":309 +/* "dependency_injector/providers/singletons.pyx":319 * * * cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<< @@ -1133,7 +1090,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_DelegatedT static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton; -/* "dependency_injector/providers/singletons.pyx":330 +/* "dependency_injector/providers/singletons.pyx":340 * * * cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<< @@ -1143,13 +1100,11 @@ static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_Del struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_ThreadLocalSingleton { struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_BaseSingleton __pyx_base; - PyObject *(*__pyx___provide)(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadLocalSingleton; -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *, PyObject *, PyObject *); -/* "dependency_injector/providers/singletons.pyx":375 +/* "dependency_injector/providers/singletons.pyx":393 * * * cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<< @@ -1334,60 +1289,6 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); -/* PyObjectSetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -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); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -/* ListExtend.proto */ -static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject* none = _PyList_Extend((PyListObject*)L, v); - if (unlikely(!none)) - return -1; - Py_DECREF(none); - return 0; -#else - return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); -#endif -} - -/* PyDictContains.proto */ -static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { - int result = PyDict_Contains(dict, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - /* PyObjectLookupSpecial.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { @@ -1433,6 +1334,24 @@ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +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); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) @@ -1452,6 +1371,42 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + /* CallNextTpDealloc.proto */ static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); @@ -1534,14 +1489,6 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleton__provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/ /* Module declarations from 'dependency_injector.providers.base' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_4base_Provider = 0; @@ -1556,6 +1503,8 @@ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_4base_Overridi static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_Injection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(PyObject *, PyObject *, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(PyObject *, PyObject *, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___inject_attributes(PyObject *, PyObject *, int); /*proto*/ @@ -1563,10 +1512,12 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject /* Module declarations from 'dependency_injector.providers.callables' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9callables_Callable = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables___call(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *, PyObject *, PyObject *); /*proto*/ /* Module declarations from 'dependency_injector.providers.factories' */ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9factories_Factory = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory = 0; +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories___call(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *, PyObject *, PyObject *); /*proto*/ /* Module declarations from 'dependency_injector.providers.utils' */ static PyObject **__pyx_vp_19dependency_injector_9providers_5utils_CLASS_TYPES = 0; @@ -1586,10 +1537,10 @@ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_10singletons_D int __pyx_module_is_main_dependency_injector__providers__singletons = 0; /* Implementation of 'dependency_injector.providers.singletons' */ -static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_range; static const char __pyx_k_id[] = "id"; static const char __pyx_k_cls[] = "cls"; @@ -1711,7 +1662,7 @@ static PyObject *__pyx_tp_new_19dependency_injector_9providers_10singletons_Thre static PyObject *__pyx_tp_new_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; -/* "dependency_injector/providers/singletons.pyx":30 +/* "dependency_injector/providers/singletons.pyx":33 * provided_type = None * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -1764,7 +1715,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_13BaseSingleto } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 30, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -1775,7 +1726,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_13BaseSingleto } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 33, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -1809,19 +1760,19 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/singletons.pyx":42 + /* "dependency_injector/providers/singletons.pyx":45 * :type kwargs: dict[str, object] * """ * if (self.__class__.provided_type and # <<<<<<<<<<<<<< * not issubclass(provides, self.__class__.provided_type)): * raise Error('{0} can provide only {1} instances'.format( */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { @@ -1829,25 +1780,25 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto goto __pyx_L4_bool_binop_done; } - /* "dependency_injector/providers/singletons.pyx":43 + /* "dependency_injector/providers/singletons.pyx":46 * """ * if (self.__class__.provided_type and * not issubclass(provides, self.__class__.provided_type)): # <<<<<<<<<<<<<< * raise Error('{0} can provide only {1} instances'.format( * self.__class__, self.__class__.provided_type)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 43, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = PyObject_IsSubclass(__pyx_v_provides, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 43, __pyx_L1_error) + __pyx_t_4 = PyObject_IsSubclass(__pyx_v_provides, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); __pyx_t_1 = __pyx_t_5; __pyx_L4_bool_binop_done:; - /* "dependency_injector/providers/singletons.pyx":42 + /* "dependency_injector/providers/singletons.pyx":45 * :type kwargs: dict[str, object] * """ * if (self.__class__.provided_type and # <<<<<<<<<<<<<< @@ -1856,30 +1807,30 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto */ if (__pyx_t_1) { - /* "dependency_injector/providers/singletons.pyx":44 + /* "dependency_injector/providers/singletons.pyx":47 * if (self.__class__.provided_type and * not issubclass(provides, self.__class__.provided_type)): * raise Error('{0} can provide only {1} instances'.format( # <<<<<<<<<<<<<< * self.__class__, self.__class__.provided_type)) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_provide_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_provide_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "dependency_injector/providers/singletons.pyx":45 + /* "dependency_injector/providers/singletons.pyx":48 * not issubclass(provides, self.__class__.provided_type)): * raise Error('{0} can provide only {1} instances'.format( * self.__class__, self.__class__.provided_type)) # <<<<<<<<<<<<<< * * self.__instantiator = Factory(provides, *args, **kwargs) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 45, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 45, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -1897,7 +1848,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -1907,7 +1858,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -1915,7 +1866,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -1926,7 +1877,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -1942,14 +1893,14 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto } } if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -1958,20 +1909,20 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -1979,9 +1930,9 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto __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(1, 44, __pyx_L1_error) + __PYX_ERR(0, 47, __pyx_L1_error) - /* "dependency_injector/providers/singletons.pyx":42 + /* "dependency_injector/providers/singletons.pyx":45 * :type kwargs: dict[str, object] * """ * if (self.__class__.provided_type and # <<<<<<<<<<<<<< @@ -1990,22 +1941,22 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto */ } - /* "dependency_injector/providers/singletons.pyx":47 + /* "dependency_injector/providers/singletons.pyx":50 * self.__class__, self.__class__.provided_type)) * * self.__instantiator = Factory(provides, *args, **kwargs) # <<<<<<<<<<<<<< * * super(BaseSingleton, self).__init__() */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_provides); __Pyx_GIVEREF(__pyx_v_provides); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_Factory), __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_9factories_Factory), __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); @@ -2014,14 +1965,14 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto __pyx_v_self->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":49 + /* "dependency_injector/providers/singletons.pyx":52 * self.__instantiator = Factory(provides, *args, **kwargs) * * super(BaseSingleton, self).__init__() # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 49, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton)); @@ -2029,10 +1980,10 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 49, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 49, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -2046,16 +1997,16 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto } } if (__pyx_t_12) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":30 + /* "dependency_injector/providers/singletons.pyx":33 * provided_type = None * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -2082,7 +2033,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_13BaseSingleto return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":51 +/* "dependency_injector/providers/singletons.pyx":54 * super(BaseSingleton, self).__init__() * * def __str__(self): # <<<<<<<<<<<<<< @@ -2114,7 +2065,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__str__", 0); - /* "dependency_injector/providers/singletons.pyx":56 + /* "dependency_injector/providers/singletons.pyx":59 * :rtype: str * """ * return represent_provider(provider=self, # <<<<<<<<<<<<<< @@ -2123,31 +2074,31 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi */ __Pyx_XDECREF(__pyx_r); - /* "dependency_injector/providers/singletons.pyx":57 + /* "dependency_injector/providers/singletons.pyx":60 * """ * return represent_provider(provider=self, * provides=self.__instantiator.cls) # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/providers/singletons.pyx":56 + /* "dependency_injector/providers/singletons.pyx":59 * :rtype: str * """ * return represent_provider(provider=self, # <<<<<<<<<<<<<< * provides=self.__instantiator.cls) * */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_5utils_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_5utils_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":51 + /* "dependency_injector/providers/singletons.pyx":54 * super(BaseSingleton, self).__init__() * * def __str__(self): # <<<<<<<<<<<<<< @@ -2167,7 +2118,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":59 +/* "dependency_injector/providers/singletons.pyx":62 * provides=self.__instantiator.cls) * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -2207,21 +2158,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__deepcopy__", 0); - /* "dependency_injector/providers/singletons.pyx":61 + /* "dependency_injector/providers/singletons.pyx":64 * def __deepcopy__(self, memo): * """Create and return full copy of provider.""" * copied = memo.get(id(self)) # <<<<<<<<<<<<<< * if copied is not None: * return copied */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -2235,14 +2186,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2251,20 +2202,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -2273,7 +2224,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_v_copied = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":62 + /* "dependency_injector/providers/singletons.pyx":65 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -2284,7 +2235,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "dependency_injector/providers/singletons.pyx":63 + /* "dependency_injector/providers/singletons.pyx":66 * copied = memo.get(id(self)) * if copied is not None: * return copied # <<<<<<<<<<<<<< @@ -2296,7 +2247,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":62 + /* "dependency_injector/providers/singletons.pyx":65 * """Create and return full copy of provider.""" * copied = memo.get(id(self)) * if copied is not None: # <<<<<<<<<<<<<< @@ -2305,91 +2256,91 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi */ } - /* "dependency_injector/providers/singletons.pyx":65 + /* "dependency_injector/providers/singletons.pyx":68 * return copied * * copied = self.__class__(self.cls, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":66 + /* "dependency_injector/providers/singletons.pyx":69 * * copied = self.__class__(self.cls, * *deepcopy(self.args, memo), # <<<<<<<<<<<<<< * **deepcopy(self.kwargs, memo)) * copied.set_attributes(**deepcopy(self.attributes, memo)) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 66, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 66, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":65 + /* "dependency_injector/providers/singletons.pyx":68 * return copied * * copied = self.__class__(self.cls, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":67 + /* "dependency_injector/providers/singletons.pyx":70 * copied = self.__class__(self.cls, * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) # <<<<<<<<<<<<<< * copied.set_attributes(**deepcopy(self.attributes, memo)) * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 67, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 70, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(1, 67, __pyx_L1_error) + __PYX_ERR(0, 70, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_3))) { - __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "dependency_injector/providers/singletons.pyx":65 + /* "dependency_injector/providers/singletons.pyx":68 * return copied * * copied = self.__class__(self.cls, # <<<<<<<<<<<<<< * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2397,58 +2348,58 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/singletons.pyx":68 + /* "dependency_injector/providers/singletons.pyx":71 * *deepcopy(self.args, memo), * **deepcopy(self.kwargs, memo)) * copied.set_attributes(**deepcopy(self.attributes, memo)) # <<<<<<<<<<<<<< * * for overriding_provider in self.overridden: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 68, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_4, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_t_4, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(1, 68, __pyx_L1_error) + __PYX_ERR(0, 71, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_1))) { - __pyx_t_2 = PyDict_Copy(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_2 = PyDict_Copy(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":70 + /* "dependency_injector/providers/singletons.pyx":73 * copied.set_attributes(**deepcopy(self.attributes, memo)) * * for overriding_provider in self.overridden: # <<<<<<<<<<<<<< * copied.override(deepcopy(overriding_provider, memo)) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __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_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 73, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -2456,17 +2407,17 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -2476,7 +2427,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(1, 70, __pyx_L1_error) + else __PYX_ERR(0, 73, __pyx_L1_error) } break; } @@ -2485,19 +2436,19 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":71 + /* "dependency_injector/providers/singletons.pyx":74 * * for overriding_provider in self.overridden: * copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<< * * return copied */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 71, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_t_8.__pyx_n = 1; __pyx_t_8.memo = ((PyObject*)__pyx_v_memo); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_5utils_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -2510,14 +2461,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi } } if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2526,20 +2477,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -2547,7 +2498,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":70 + /* "dependency_injector/providers/singletons.pyx":73 * copied.set_attributes(**deepcopy(self.attributes, memo)) * * for overriding_provider in self.overridden: # <<<<<<<<<<<<<< @@ -2557,7 +2508,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":73 + /* "dependency_injector/providers/singletons.pyx":76 * copied.override(deepcopy(overriding_provider, memo)) * * return copied # <<<<<<<<<<<<<< @@ -2569,7 +2520,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = __pyx_v_copied; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":59 + /* "dependency_injector/providers/singletons.pyx":62 * provides=self.__instantiator.cls) * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -2595,7 +2546,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":76 +/* "dependency_injector/providers/singletons.pyx":79 * * @property * def cls(self): # <<<<<<<<<<<<<< @@ -2622,7 +2573,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/singletons.pyx":78 + /* "dependency_injector/providers/singletons.pyx":81 * def cls(self): * """Return provided type.""" * return self.__instantiator.cls # <<<<<<<<<<<<<< @@ -2630,13 +2581,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":76 + /* "dependency_injector/providers/singletons.pyx":79 * * @property * def cls(self): # <<<<<<<<<<<<<< @@ -2655,7 +2606,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":81 +/* "dependency_injector/providers/singletons.pyx":84 * * @property * def args(self): # <<<<<<<<<<<<<< @@ -2682,7 +2633,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/singletons.pyx":83 + /* "dependency_injector/providers/singletons.pyx":86 * def args(self): * """Return positional argument injections.""" * return self.__instantiator.args # <<<<<<<<<<<<<< @@ -2690,13 +2641,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi * def add_args(self, *args): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":81 + /* "dependency_injector/providers/singletons.pyx":84 * * @property * def args(self): # <<<<<<<<<<<<<< @@ -2715,7 +2666,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":85 +/* "dependency_injector/providers/singletons.pyx":88 * return self.__instantiator.args * * def add_args(self, *args): # <<<<<<<<<<<<<< @@ -2749,21 +2700,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("add_args", 0); - /* "dependency_injector/providers/singletons.pyx":93 + /* "dependency_injector/providers/singletons.pyx":96 * :return: Reference ``self`` * """ * self.__instantiator.add_args(*args) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __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; - /* "dependency_injector/providers/singletons.pyx":94 + /* "dependency_injector/providers/singletons.pyx":97 * """ * self.__instantiator.add_args(*args) * return self # <<<<<<<<<<<<<< @@ -2775,7 +2726,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":85 + /* "dependency_injector/providers/singletons.pyx":88 * return self.__instantiator.args * * def add_args(self, *args): # <<<<<<<<<<<<<< @@ -2795,7 +2746,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":96 +/* "dependency_injector/providers/singletons.pyx":99 * return self * * def set_args(self, *args): # <<<<<<<<<<<<<< @@ -2829,21 +2780,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_args", 0); - /* "dependency_injector/providers/singletons.pyx":106 + /* "dependency_injector/providers/singletons.pyx":109 * :return: Reference ``self`` * """ * self.__instantiator.set_args(*args) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __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; - /* "dependency_injector/providers/singletons.pyx":107 + /* "dependency_injector/providers/singletons.pyx":110 * """ * self.__instantiator.set_args(*args) * return self # <<<<<<<<<<<<<< @@ -2855,7 +2806,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":96 + /* "dependency_injector/providers/singletons.pyx":99 * return self * * def set_args(self, *args): # <<<<<<<<<<<<<< @@ -2875,7 +2826,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":109 +/* "dependency_injector/providers/singletons.pyx":112 * return self * * def clear_args(self): # <<<<<<<<<<<<<< @@ -2905,14 +2856,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("clear_args", 0); - /* "dependency_injector/providers/singletons.pyx":114 + /* "dependency_injector/providers/singletons.pyx":117 * :return: Reference ``self`` * """ * self.__instantiator.clear_args() # <<<<<<<<<<<<<< * return self * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2925,16 +2876,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":115 + /* "dependency_injector/providers/singletons.pyx":118 * """ * self.__instantiator.clear_args() * return self # <<<<<<<<<<<<<< @@ -2946,7 +2897,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":109 + /* "dependency_injector/providers/singletons.pyx":112 * return self * * def clear_args(self): # <<<<<<<<<<<<<< @@ -2967,7 +2918,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":118 +/* "dependency_injector/providers/singletons.pyx":121 * * @property * def kwargs(self): # <<<<<<<<<<<<<< @@ -2994,7 +2945,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/singletons.pyx":120 + /* "dependency_injector/providers/singletons.pyx":123 * def kwargs(self): * """Return keyword argument injections.""" * return self.__instantiator.kwargs # <<<<<<<<<<<<<< @@ -3002,13 +2953,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi * def add_kwargs(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":118 + /* "dependency_injector/providers/singletons.pyx":121 * * @property * def kwargs(self): # <<<<<<<<<<<<<< @@ -3027,7 +2978,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":122 +/* "dependency_injector/providers/singletons.pyx":125 * return self.__instantiator.kwargs * * def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -3067,21 +3018,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("add_kwargs", 0); - /* "dependency_injector/providers/singletons.pyx":130 + /* "dependency_injector/providers/singletons.pyx":133 * :return: Reference ``self`` * """ * self.__instantiator.add_kwargs(**kwargs) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __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; - /* "dependency_injector/providers/singletons.pyx":131 + /* "dependency_injector/providers/singletons.pyx":134 * """ * self.__instantiator.add_kwargs(**kwargs) * return self # <<<<<<<<<<<<<< @@ -3093,7 +3044,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":122 + /* "dependency_injector/providers/singletons.pyx":125 * return self.__instantiator.kwargs * * def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -3113,7 +3064,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":133 +/* "dependency_injector/providers/singletons.pyx":136 * return self * * def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -3153,21 +3104,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_kwargs", 0); - /* "dependency_injector/providers/singletons.pyx":143 + /* "dependency_injector/providers/singletons.pyx":146 * :return: Reference ``self`` * """ * self.__instantiator.set_kwargs(**kwargs) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 143, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __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; - /* "dependency_injector/providers/singletons.pyx":144 + /* "dependency_injector/providers/singletons.pyx":147 * """ * self.__instantiator.set_kwargs(**kwargs) * return self # <<<<<<<<<<<<<< @@ -3179,7 +3130,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":133 + /* "dependency_injector/providers/singletons.pyx":136 * return self * * def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<< @@ -3199,7 +3150,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":146 +/* "dependency_injector/providers/singletons.pyx":149 * return self * * def clear_kwargs(self): # <<<<<<<<<<<<<< @@ -3229,14 +3180,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("clear_kwargs", 0); - /* "dependency_injector/providers/singletons.pyx":151 + /* "dependency_injector/providers/singletons.pyx":154 * :return: Reference ``self`` * """ * self.__instantiator.clear_kwargs() # <<<<<<<<<<<<<< * return self * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3249,16 +3200,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":152 + /* "dependency_injector/providers/singletons.pyx":155 * """ * self.__instantiator.clear_kwargs() * return self # <<<<<<<<<<<<<< @@ -3270,7 +3221,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":146 + /* "dependency_injector/providers/singletons.pyx":149 * return self * * def clear_kwargs(self): # <<<<<<<<<<<<<< @@ -3291,7 +3242,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":155 +/* "dependency_injector/providers/singletons.pyx":158 * * @property * def attributes(self): # <<<<<<<<<<<<<< @@ -3318,7 +3269,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "dependency_injector/providers/singletons.pyx":157 + /* "dependency_injector/providers/singletons.pyx":160 * def attributes(self): * """Return attribute injections.""" * return self.__instantiator.attributes # <<<<<<<<<<<<<< @@ -3326,13 +3277,13 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi * def add_attributes(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":155 + /* "dependency_injector/providers/singletons.pyx":158 * * @property * def attributes(self): # <<<<<<<<<<<<<< @@ -3351,7 +3302,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":159 +/* "dependency_injector/providers/singletons.pyx":162 * return self.__instantiator.attributes * * def add_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3391,21 +3342,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("add_attributes", 0); - /* "dependency_injector/providers/singletons.pyx":167 + /* "dependency_injector/providers/singletons.pyx":170 * :return: Reference ``self`` * """ * self.__instantiator.add_attributes(**kwargs) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 167, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 167, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __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; - /* "dependency_injector/providers/singletons.pyx":168 + /* "dependency_injector/providers/singletons.pyx":171 * """ * self.__instantiator.add_attributes(**kwargs) * return self # <<<<<<<<<<<<<< @@ -3417,7 +3368,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":159 + /* "dependency_injector/providers/singletons.pyx":162 * return self.__instantiator.attributes * * def add_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3437,7 +3388,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":170 +/* "dependency_injector/providers/singletons.pyx":173 * return self * * def set_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3477,21 +3428,21 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_attributes", 0); - /* "dependency_injector/providers/singletons.pyx":180 + /* "dependency_injector/providers/singletons.pyx":183 * :return: Reference ``self`` * """ * self.__instantiator.set_attributes(**kwargs) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __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; - /* "dependency_injector/providers/singletons.pyx":181 + /* "dependency_injector/providers/singletons.pyx":184 * """ * self.__instantiator.set_attributes(**kwargs) * return self # <<<<<<<<<<<<<< @@ -3503,7 +3454,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":170 + /* "dependency_injector/providers/singletons.pyx":173 * return self * * def set_attributes(self, **kwargs): # <<<<<<<<<<<<<< @@ -3523,7 +3474,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":183 +/* "dependency_injector/providers/singletons.pyx":186 * return self * * def clear_attributes(self): # <<<<<<<<<<<<<< @@ -3553,14 +3504,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("clear_attributes", 0); - /* "dependency_injector/providers/singletons.pyx":188 + /* "dependency_injector/providers/singletons.pyx":191 * :return: Reference ``self`` * """ * self.__instantiator.clear_attributes() # <<<<<<<<<<<<<< * return self * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_attributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_attributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3573,16 +3524,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":189 + /* "dependency_injector/providers/singletons.pyx":192 * """ * self.__instantiator.clear_attributes() * return self # <<<<<<<<<<<<<< @@ -3594,7 +3545,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":183 + /* "dependency_injector/providers/singletons.pyx":186 * return self * * def clear_attributes(self): # <<<<<<<<<<<<<< @@ -3615,7 +3566,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":191 +/* "dependency_injector/providers/singletons.pyx":194 * return self * * def reset(self): # <<<<<<<<<<<<<< @@ -3643,20 +3594,20 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("reset", 0); - /* "dependency_injector/providers/singletons.pyx":196 + /* "dependency_injector/providers/singletons.pyx":199 * :rtype: None * """ * raise NotImplementedError() # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __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(1, 196, __pyx_L1_error) + __PYX_ERR(0, 199, __pyx_L1_error) - /* "dependency_injector/providers/singletons.pyx":191 + /* "dependency_injector/providers/singletons.pyx":194 * return self * * def reset(self): # <<<<<<<<<<<<<< @@ -3674,7 +3625,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_13BaseSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":230 +/* "dependency_injector/providers/singletons.pyx":233 * """ * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -3727,7 +3678,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_9Singleton_1__ } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 230, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 233, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -3738,7 +3689,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_9Singleton_1__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 230, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 233, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -3763,7 +3714,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_9Singleton___i PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/singletons.pyx":242 + /* "dependency_injector/providers/singletons.pyx":245 * :type kwargs: dict[str, object] * """ * self.__storage = None # <<<<<<<<<<<<<< @@ -3776,14 +3727,14 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_9Singleton___i __Pyx_DECREF(__pyx_v_self->__pyx___storage); __pyx_v_self->__pyx___storage = Py_None; - /* "dependency_injector/providers/singletons.pyx":243 + /* "dependency_injector/providers/singletons.pyx":246 * """ * self.__storage = None * super(Singleton, self).__init__(provides, *args, **kwargs) # <<<<<<<<<<<<<< * * def reset(self): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_Singleton)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_Singleton)); @@ -3791,27 +3742,27 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_9Singleton___i __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_provides); __Pyx_GIVEREF(__pyx_v_provides); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":230 + /* "dependency_injector/providers/singletons.pyx":233 * """ * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -3833,7 +3784,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_9Singleton___i return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":245 +/* "dependency_injector/providers/singletons.pyx":248 * super(Singleton, self).__init__(provides, *args, **kwargs) * * def reset(self): # <<<<<<<<<<<<<< @@ -3860,7 +3811,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_9Singlet __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); - /* "dependency_injector/providers/singletons.pyx":250 + /* "dependency_injector/providers/singletons.pyx":253 * :rtype: None * """ * self.__storage = None # <<<<<<<<<<<<<< @@ -3873,7 +3824,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_9Singlet __Pyx_DECREF(__pyx_v_self->__pyx___storage); __pyx_v_self->__pyx___storage = Py_None; - /* "dependency_injector/providers/singletons.pyx":245 + /* "dependency_injector/providers/singletons.pyx":248 * super(Singleton, self).__init__(provides, *args, **kwargs) * * def reset(self): # <<<<<<<<<<<<<< @@ -3888,12 +3839,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_9Singlet return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":252 +/* "dependency_injector/providers/singletons.pyx":255 * self.__storage = None * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return single instance.""" - * return self.__provide(args, kwargs) + * if self.__storage is None: */ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_9Singleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -3906,12 +3857,14 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleto PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; __Pyx_RefNannySetupContext("_provide", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_10singletons_9Singleton_5_provide)) { __Pyx_XDECREF(__pyx_r); @@ -3931,7 +3884,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleto #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -3939,13 +3892,13 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleto #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 252, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -3956,7 +3909,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleto __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -3969,26 +3922,78 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleto __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/singletons.pyx":254 + /* "dependency_injector/providers/singletons.pyx":257 * cpdef object _provide(self, tuple args, dict kwargs): * """Return single instance.""" - * return self.__provide(args, kwargs) # <<<<<<<<<<<<<< + * if self.__storage is None: # <<<<<<<<<<<<<< + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) + */ + __pyx_t_7 = (__pyx_v_self->__pyx___storage == Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "dependency_injector/providers/singletons.pyx":258 + * """Return single instance.""" + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, # <<<<<<<<<<<<<< + * args, kwargs) + * return self.__storage + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx___instantiator); + __Pyx_INCREF(__pyx_t_1); + + /* "dependency_injector/providers/singletons.pyx":259 + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) # <<<<<<<<<<<<<< + * return self.__storage + * + */ + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_9factories___call(((struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "dependency_injector/providers/singletons.pyx":258 + * """Return single instance.""" + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, # <<<<<<<<<<<<<< + * args, kwargs) + * return self.__storage + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->__pyx___storage); + __Pyx_DECREF(__pyx_v_self->__pyx___storage); + __pyx_v_self->__pyx___storage = __pyx_t_2; + __pyx_t_2 = 0; + + /* "dependency_injector/providers/singletons.pyx":257 + * cpdef object _provide(self, tuple args, dict kwargs): + * """Return single instance.""" + * if self.__storage is None: # <<<<<<<<<<<<<< + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) + */ + } + + /* "dependency_injector/providers/singletons.pyx":260 + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) + * return self.__storage # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_9Singleton___provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_self->__pyx___storage); + __pyx_r = __pyx_v_self->__pyx___storage; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":252 + /* "dependency_injector/providers/singletons.pyx":255 * self.__storage = None * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return single instance.""" - * return self.__provide(args, kwargs) + * if self.__storage is None: */ /* function exit code */ @@ -4035,11 +4040,11 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_9Singlet case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 252, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 255, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 252, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 255, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4052,14 +4057,14 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_9Singlet } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 252, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 255, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.singletons.Singleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 252, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 252, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 255, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_10singletons_9Singleton_4_provide(((struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ @@ -4077,7 +4082,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_9Singlet PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_provide", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_9Singleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_9Singleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4094,7 +4099,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_9Singlet return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":281 +/* "dependency_injector/providers/singletons.pyx":287 * """Thread-safe singleton provider.""" * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4147,7 +4152,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_19ThreadSafeSi } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 287, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -4158,7 +4163,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_19ThreadSafeSi } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 287, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -4183,7 +4188,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_19ThreadSafeSi PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/singletons.pyx":293 + /* "dependency_injector/providers/singletons.pyx":299 * :type kwargs: dict[str, object] * """ * self.__storage = None # <<<<<<<<<<<<<< @@ -4196,14 +4201,14 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_19ThreadSafeSi __Pyx_DECREF(__pyx_v_self->__pyx___storage); __pyx_v_self->__pyx___storage = Py_None; - /* "dependency_injector/providers/singletons.pyx":294 + /* "dependency_injector/providers/singletons.pyx":300 * """ * self.__storage = None * self.__lock = GLOBAL_LOCK # <<<<<<<<<<<<<< * super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs) * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GLOBAL_LOCK); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 294, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GLOBAL_LOCK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___lock); @@ -4211,14 +4216,14 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_19ThreadSafeSi __pyx_v_self->__pyx___lock = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":295 + /* "dependency_injector/providers/singletons.pyx":301 * self.__storage = None * self.__lock = GLOBAL_LOCK * super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs) # <<<<<<<<<<<<<< * * def reset(self): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_ThreadSafeSingleton)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_ThreadSafeSingleton)); @@ -4226,27 +4231,27 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_19ThreadSafeSi __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_provides); __Pyx_GIVEREF(__pyx_v_provides); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); 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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/providers/singletons.pyx":281 + /* "dependency_injector/providers/singletons.pyx":287 * """Thread-safe singleton provider.""" * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4268,7 +4273,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_19ThreadSafeSi return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":297 +/* "dependency_injector/providers/singletons.pyx":303 * super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs) * * def reset(self): # <<<<<<<<<<<<<< @@ -4295,7 +4300,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_19Thread __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); - /* "dependency_injector/providers/singletons.pyx":302 + /* "dependency_injector/providers/singletons.pyx":308 * :rtype: None * """ * self.__storage = None # <<<<<<<<<<<<<< @@ -4308,7 +4313,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_19Thread __Pyx_DECREF(__pyx_v_self->__pyx___storage); __pyx_v_self->__pyx___storage = Py_None; - /* "dependency_injector/providers/singletons.pyx":297 + /* "dependency_injector/providers/singletons.pyx":303 * super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs) * * def reset(self): # <<<<<<<<<<<<<< @@ -4323,12 +4328,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_19Thread return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":304 +/* "dependency_injector/providers/singletons.pyx":310 * self.__storage = None * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return single instance.""" - * return self.__provide(args, kwargs) + * with self.__lock: */ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -4341,12 +4346,19 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadS PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; __Pyx_RefNannySetupContext("_provide", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton_5_provide)) { __Pyx_XDECREF(__pyx_r); @@ -4366,7 +4378,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadS #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -4374,13 +4386,13 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadS #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 304, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -4391,7 +4403,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadS __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -4404,26 +4416,204 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadS __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/singletons.pyx":306 + /* "dependency_injector/providers/singletons.pyx":312 * cpdef object _provide(self, tuple args, dict kwargs): * """Return single instance.""" - * return self.__provide(args, kwargs) # <<<<<<<<<<<<<< + * with self.__lock: # <<<<<<<<<<<<<< + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, + */ + /*with:*/ { + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L3_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__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_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "dependency_injector/providers/singletons.pyx":313 + * """Return single instance.""" + * with self.__lock: + * if self.__storage is None: # <<<<<<<<<<<<<< + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) + */ + __pyx_t_11 = (__pyx_v_self->__pyx___storage == Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "dependency_injector/providers/singletons.pyx":314 + * with self.__lock: + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, # <<<<<<<<<<<<<< + * args, kwargs) + * return self.__storage + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx___instantiator); + __Pyx_INCREF(__pyx_t_1); + + /* "dependency_injector/providers/singletons.pyx":315 + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) # <<<<<<<<<<<<<< + * return self.__storage + * + */ + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_9factories___call(((struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "dependency_injector/providers/singletons.pyx":314 + * with self.__lock: + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, # <<<<<<<<<<<<<< + * args, kwargs) + * return self.__storage + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->__pyx___storage); + __Pyx_DECREF(__pyx_v_self->__pyx___storage); + __pyx_v_self->__pyx___storage = __pyx_t_2; + __pyx_t_2 = 0; + + /* "dependency_injector/providers/singletons.pyx":313 + * """Return single instance.""" + * with self.__lock: + * if self.__storage is None: # <<<<<<<<<<<<<< + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) + */ + } + + /* "dependency_injector/providers/singletons.pyx":312 + * cpdef object _provide(self, tuple args, dict kwargs): + * """Return single instance.""" + * with self.__lock: # <<<<<<<<<<<<<< + * if self.__storage is None: + * self.__storage = __call_factory(self.__instantiator, + */ + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + /*except:*/ { + __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadSafeSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 312, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 312, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_12 < 0) __PYX_ERR(0, 312, __pyx_L9_except_error) + __pyx_t_11 = ((!(__pyx_t_12 != 0)) != 0); + if (__pyx_t_11) { + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3); + __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; + __PYX_ERR(0, 312, __pyx_L9_except_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L14_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_7) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple_, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L6; + } + __pyx_L6:; + } + goto __pyx_L19; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L1_error; + __pyx_L19:; + } + + /* "dependency_injector/providers/singletons.pyx":316 + * self.__storage = __call_factory(self.__instantiator, + * args, kwargs) + * return self.__storage # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_self->__pyx___storage); + __pyx_r = __pyx_v_self->__pyx___storage; goto __pyx_L0; - /* "dependency_injector/providers/singletons.pyx":304 + /* "dependency_injector/providers/singletons.pyx":310 * self.__storage = None * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return single instance.""" - * return self.__provide(args, kwargs) + * with self.__lock: */ /* function exit code */ @@ -4470,11 +4660,11 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_19Thread case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 310, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 304, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 310, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4487,14 +4677,14 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_19Thread } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 310, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadSafeSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 304, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 304, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 310, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton_4_provide(((struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ @@ -4512,7 +4702,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_19Thread PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_provide", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4529,7 +4719,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_19Thread return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":348 +/* "dependency_injector/providers/singletons.pyx":358 * """ * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4582,7 +4772,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_20ThreadLocalS } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 348, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -4593,7 +4783,7 @@ static int __pyx_pw_19dependency_injector_9providers_10singletons_20ThreadLocalS } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 348, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -4618,16 +4808,16 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_20ThreadLocalS PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/providers/singletons.pyx":360 + /* "dependency_injector/providers/singletons.pyx":370 * :type kwargs: dict[str, object] * """ * self.__storage = threading.local() # <<<<<<<<<<<<<< * super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs) * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_local); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 360, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_local); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -4641,10 +4831,10 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_20ThreadLocalS } } if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4654,14 +4844,14 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_20ThreadLocalS __pyx_v_self->__pyx___storage = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/providers/singletons.pyx":361 + /* "dependency_injector/providers/singletons.pyx":371 * """ * self.__storage = threading.local() * super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs) # <<<<<<<<<<<<<< * * def reset(self): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 361, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_ThreadLocalSingleton)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_ThreadLocalSingleton)); @@ -4669,27 +4859,27 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_20ThreadLocalS __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 361, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 361, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_provides); __Pyx_GIVEREF(__pyx_v_provides); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_provides); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 361, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 361, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/providers/singletons.pyx":348 + /* "dependency_injector/providers/singletons.pyx":358 * """ * * def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4711,7 +4901,7 @@ static int __pyx_pf_19dependency_injector_9providers_10singletons_20ThreadLocalS return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":363 +/* "dependency_injector/providers/singletons.pyx":373 * super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs) * * def reset(self): # <<<<<<<<<<<<<< @@ -4738,16 +4928,16 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_20Thread __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); - /* "dependency_injector/providers/singletons.pyx":368 + /* "dependency_injector/providers/singletons.pyx":378 * :rtype: None * """ * self.__storage.instance = None # <<<<<<<<<<<<<< * * cpdef object _provide(self, tuple args, dict kwargs): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance, Py_None) < 0) __PYX_ERR(1, 368, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance, Py_None) < 0) __PYX_ERR(0, 378, __pyx_L1_error) - /* "dependency_injector/providers/singletons.pyx":363 + /* "dependency_injector/providers/singletons.pyx":373 * super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs) * * def reset(self): # <<<<<<<<<<<<<< @@ -4767,16 +4957,17 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_20Thread return __pyx_r; } -/* "dependency_injector/providers/singletons.pyx":370 +/* "dependency_injector/providers/singletons.pyx":380 * self.__storage.instance = None * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return single instance.""" - * return self.__provide(args, kwargs) + * cdef object instance */ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) { + PyObject *__pyx_v_instance = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4785,12 +4976,18 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadL PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("_provide", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton_5_provide)) { __Pyx_XDECREF(__pyx_r); @@ -4810,7 +5007,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadL #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -4818,13 +5015,13 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadL #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 370, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -4835,7 +5032,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadL __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -4848,26 +5045,198 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dependency_injector/providers/singletons.pyx":372 - * cpdef object _provide(self, tuple args, dict kwargs): - * """Return single instance.""" - * return self.__provide(args, kwargs) # <<<<<<<<<<<<<< + /* "dependency_injector/providers/singletons.pyx":384 + * cdef object instance + * + * try: # <<<<<<<<<<<<<< + * instance = self.__storage.instance + * except AttributeError: + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "dependency_injector/providers/singletons.pyx":385 + * + * try: + * instance = self.__storage.instance # <<<<<<<<<<<<<< + * except AttributeError: + * instance = __call_factory(self.__instantiator, args, kwargs) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_instance = __pyx_t_1; + __pyx_t_1 = 0; + + /* "dependency_injector/providers/singletons.pyx":384 + * cdef object instance + * + * try: # <<<<<<<<<<<<<< + * instance = self.__storage.instance + * except AttributeError: + */ + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "dependency_injector/providers/singletons.pyx":386 + * try: + * instance = self.__storage.instance + * except AttributeError: # <<<<<<<<<<<<<< + * instance = __call_factory(self.__instantiator, args, kwargs) + * self.__storage.instance = instance + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 386, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + /* "dependency_injector/providers/singletons.pyx":387 + * instance = self.__storage.instance + * except AttributeError: + * instance = __call_factory(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<< + * self.__storage.instance = instance + * finally: + */ + __pyx_t_6 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx___instantiator); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_9factories___call(((struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *)__pyx_t_6), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_instance, __pyx_t_4); + __pyx_t_4 = 0; + + /* "dependency_injector/providers/singletons.pyx":388 + * except AttributeError: + * instance = __call_factory(self.__instantiator, args, kwargs) + * self.__storage.instance = instance # <<<<<<<<<<<<<< + * finally: + * return instance + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance, __pyx_v_instance) < 0) __PYX_ERR(0, 388, __pyx_L8_except_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "dependency_injector/providers/singletons.pyx":384 + * cdef object instance + * + * try: # <<<<<<<<<<<<<< + * instance = self.__storage.instance + * except AttributeError: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L4_error; + __pyx_L7_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L13_try_end:; + } + } + + /* "dependency_injector/providers/singletons.pyx":390 + * self.__storage.instance = instance + * finally: + * return instance # <<<<<<<<<<<<<< * * */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + /*finally:*/ { + /*normal exit:*/{ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_instance); + __pyx_r = __pyx_v_instance; + goto __pyx_L0; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L4_error:; + __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + { + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_instance)) { __Pyx_RaiseUnboundLocalError("instance"); __PYX_ERR(0, 390, __pyx_L17_error) } + __Pyx_INCREF(__pyx_v_instance); + __pyx_r = __pyx_v_instance; + goto __pyx_L16_return; + } + __pyx_L16_return:; + __Pyx_PyThreadState_assign + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + goto __pyx_L0; + __pyx_L17_error:; + __Pyx_PyThreadState_assign + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + goto __pyx_L1_error; + } + } - /* "dependency_injector/providers/singletons.pyx":370 + /* "dependency_injector/providers/singletons.pyx":380 * self.__storage.instance = None * * cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * """Return single instance.""" - * return self.__provide(args, kwargs) + * cdef object instance */ /* function exit code */ @@ -4880,6 +5249,7 @@ static PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadL __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_instance); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4914,11 +5284,11 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_20Thread case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 370, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(0, 380, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 370, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(0, 380, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4931,14 +5301,14 @@ static PyObject *__pyx_pw_19dependency_injector_9providers_10singletons_20Thread } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 370, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 380, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 370, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 370, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 380, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton_4_provide(((struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ @@ -4956,7 +5326,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_20Thread PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_provide", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4973,136 +5343,36 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_10singletons_20Thread return __pyx_r; } -/* "injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__get_value", 0); - - /* "injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); - if (__pyx_t_1) { - - /* "injections.pxd":21 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_r = __pyx_v_self->__pyx___value; - goto __pyx_L0; - - /* "injections.pxd":20 - * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() - */ - } - - /* "injections.pxd":22 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< +/* "injections.pxd":24 * * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___value); - __pyx_t_3 = __pyx_v_self->__pyx___value; __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && 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); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 22, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "injections.pxd":19 - * cdef int __call - * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.PositionalInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "injections.pxd":32 - * cdef int __call - * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_name(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get_name", 0); - /* "injections.pxd":33 + /* "injections.pxd":25 + * + * cdef inline object __get_name(NamedInjection self): + * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_name(self): - * return self.__name # <<<<<<<<<<<<<< * - * cdef inline object __get_value(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx___name); __pyx_r = __pyx_v_self->__pyx___name; goto __pyx_L0; - /* "injections.pxd":32 - * cdef int __call + /* "injections.pxd":24 * - * cdef inline object __get_name(self): # <<<<<<<<<<<<<< - * return self.__name + * + * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< + * return self.__name * */ @@ -5113,15 +5383,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":35 - * return self.__name +/* "injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *__pyx_v_self) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10injections___get_value(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -5130,21 +5400,21 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get_value", 0); - /* "injections.pxd":36 + /* "injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); if (__pyx_t_1) { - /* "injections.pxd":37 - * cdef inline object __get_value(self): - * if self.__call == 0: - * return self.__value # <<<<<<<<<<<<<< - * return self.__value() + /* "injections.pxd":30 + * cdef inline object __get_value(Injection self): + * if self.__call == 0: + * return self.__value # <<<<<<<<<<<<<< + * return self.__value() * */ __Pyx_XDECREF(__pyx_r); @@ -5152,19 +5422,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_self->__pyx___value; goto __pyx_L0; - /* "injections.pxd":36 + /* "injections.pxd":29 * - * cdef inline object __get_value(self): - * if self.__call == 0: # <<<<<<<<<<<<<< - * return self.__value - * return self.__value() + * cdef inline object __get_value(Injection self): + * if self.__call == 0: # <<<<<<<<<<<<<< + * return self.__value + * return self.__value() */ } - /* "injections.pxd":38 - * if self.__call == 0: - * return self.__value - * return self.__value() # <<<<<<<<<<<<<< + /* "injections.pxd":31 + * if self.__call == 0: + * return self.__value + * return self.__value() # <<<<<<<<<<<<<< * * */ @@ -5181,10 +5451,10 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5192,12 +5462,12 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_2 = 0; goto __pyx_L0; - /* "injections.pxd":35 - * return self.__name + /* "injections.pxd":28 * - * cdef inline object __get_value(self): # <<<<<<<<<<<<<< - * if self.__call == 0: - * return self.__value + * + * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< + * if self.__call == 0: + * return self.__value */ /* function exit code */ @@ -5205,7 +5475,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.providers.injections.NamedInjection.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.injections.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5213,7 +5483,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":43 +/* "injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -5234,7 +5504,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__provide_positional_args", 0); - /* "injections.pxd":50 + /* "injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -5244,7 +5514,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0); if (__pyx_t_1) { - /* "injections.pxd":51 + /* "injections.pxd":44 * * if inj_args_len == 0: * return args # <<<<<<<<<<<<<< @@ -5256,7 +5526,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_args; goto __pyx_L0; - /* "injections.pxd":50 + /* "injections.pxd":43 * cdef PositionalInjection injection * * if inj_args_len == 0: # <<<<<<<<<<<<<< @@ -5265,68 +5535,68 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ } - /* "injections.pxd":53 + /* "injections.pxd":46 * return args * * positional_args = list() # <<<<<<<<<<<<<< * for index in range(inj_args_len): * injection = inj_args[index] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 53, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "injections.pxd":54 + /* "injections.pxd":47 * * positional_args = list() * for index in range(inj_args_len): # <<<<<<<<<<<<<< * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) */ __pyx_t_3 = __pyx_v_inj_args_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":55 + /* "injections.pxd":48 * positional_args = list() * for index in range(inj_args_len): * injection = inj_args[index] # <<<<<<<<<<<<<< - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) */ if (unlikely(__pyx_v_inj_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 55, __pyx_L1_error) + __PYX_ERR(1, 48, __pyx_L1_error) } __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection *)__pyx_t_2)); __pyx_t_2 = 0; - /* "injections.pxd":56 + /* "injections.pxd":49 * for index in range(inj_args_len): * injection = inj_args[index] - * positional_args.append(injection.__get_value()) # <<<<<<<<<<<<<< + * positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<< * positional_args.extend(args) * */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections_19PositionalInjection___get_value(__pyx_v_injection); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 56, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 56, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "injections.pxd":57 + /* "injections.pxd":50 * injection = inj_args[index] - * positional_args.append(injection.__get_value()) + * positional_args.append(__get_value(injection)) * positional_args.extend(args) # <<<<<<<<<<<<<< * * return tuple(positional_args) */ - __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 57, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 50, __pyx_L1_error) - /* "injections.pxd":59 + /* "injections.pxd":52 * positional_args.extend(args) * * return tuple(positional_args) # <<<<<<<<<<<<<< @@ -5334,13 +5604,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 59, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "injections.pxd":43 + /* "injections.pxd":36 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< @@ -5361,7 +5631,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":64 +/* "injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -5383,7 +5653,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_6; __Pyx_RefNannySetupContext("__provide_keyword_args", 0); - /* "injections.pxd":71 + /* "injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -5392,69 +5662,69 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 71, __pyx_L1_error) + __PYX_ERR(1, 64, __pyx_L1_error) } - __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 71, __pyx_L1_error) + __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 64, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "injections.pxd":72 + /* "injections.pxd":65 * * if len(kwargs) == 0: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":73 + /* "injections.pxd":66 * if len(kwargs) == 0: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 73, __pyx_L1_error) + __PYX_ERR(1, 66, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "injections.pxd":74 + /* "injections.pxd":67 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) * else: */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":75 + /* "injections.pxd":68 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * else: * for index in range(inj_kwargs_len): */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 75, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 75, __pyx_L1_error) + __PYX_ERR(1, 68, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(2, 75, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - /* "injections.pxd":71 + /* "injections.pxd":64 * cdef NamedInjection kw_injection * * if len(kwargs) == 0: # <<<<<<<<<<<<<< @@ -5464,82 +5734,82 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject goto __pyx_L3; } - /* "injections.pxd":77 - * kwargs[name] = kw_injection.__get_value() + /* "injections.pxd":70 + * kwargs[name] = __get_value(kw_injection) * else: * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) */ /*else*/ { __pyx_t_3 = __pyx_v_inj_kwargs_len; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_index = __pyx_t_4; - /* "injections.pxd":78 + /* "injections.pxd":71 * else: * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] # <<<<<<<<<<<<<< - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: */ if (unlikely(__pyx_v_inj_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 78, __pyx_L1_error) + __PYX_ERR(1, 71, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_5)); __pyx_t_5 = 0; - /* "injections.pxd":79 + /* "injections.pxd":72 * for index in range(inj_kwargs_len): * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() # <<<<<<<<<<<<<< + * name = __get_name(kw_injection) # <<<<<<<<<<<<<< * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 79, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":80 + /* "injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 80, __pyx_L1_error) + __PYX_ERR(1, 73, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 80, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 73, __pyx_L1_error) __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { - /* "injections.pxd":81 - * name = kw_injection.__get_name() + /* "injections.pxd":74 + * name = __get_name(kw_injection) * if name not in kwargs: - * kwargs[name] = kw_injection.__get_value() # <<<<<<<<<<<<<< + * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * * return kwargs */ - __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 81, __pyx_L1_error) + __pyx_t_5 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 81, __pyx_L1_error) + __PYX_ERR(1, 74, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(2, 81, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "injections.pxd":80 + /* "injections.pxd":73 * kw_injection = inj_kwargs[index] - * name = kw_injection.__get_name() + * name = __get_name(kw_injection) * if name not in kwargs: # <<<<<<<<<<<<<< - * kwargs[name] = kw_injection.__get_value() + * kwargs[name] = __get_value(kw_injection) * */ } @@ -5547,8 +5817,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject } __pyx_L3:; - /* "injections.pxd":83 - * kwargs[name] = kw_injection.__get_value() + /* "injections.pxd":76 + * kwargs[name] = __get_value(kw_injection) * * return kwargs # <<<<<<<<<<<<<< * @@ -5559,7 +5829,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject __pyx_r = __pyx_v_kwargs; goto __pyx_L0; - /* "injections.pxd":64 + /* "injections.pxd":57 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< @@ -5580,7 +5850,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "injections.pxd":88 +/* "injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -5600,7 +5870,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject int __pyx_t_5; __Pyx_RefNannySetupContext("__inject_attributes", 0); - /* "injections.pxd":92 + /* "injections.pxd":85 * int attributes_len): * cdef NamedInjection attr_injection * for index in range(attributes_len): # <<<<<<<<<<<<<< @@ -5611,55 +5881,55 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_index = __pyx_t_2; - /* "injections.pxd":93 + /* "injections.pxd":86 * cdef NamedInjection attr_injection * for index in range(attributes_len): * attr_injection = attributes[index] # <<<<<<<<<<<<<< * setattr(instance, - * attr_injection.__get_name(), + * __get_name(attr_injection), */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 93, __pyx_L1_error) + __PYX_ERR(1, 86, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index); __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection *)__pyx_t_3)); __pyx_t_3 = 0; - /* "injections.pxd":95 + /* "injections.pxd":88 * attr_injection = attributes[index] * setattr(instance, - * attr_injection.__get_name(), # <<<<<<<<<<<<<< - * attr_injection.__get_value()) + * __get_name(attr_injection), # <<<<<<<<<<<<<< + * __get_value(attr_injection)) * */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 95, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "injections.pxd":96 + /* "injections.pxd":89 * setattr(instance, - * attr_injection.__get_name(), - * attr_injection.__get_value()) # <<<<<<<<<<<<<< + * __get_name(attr_injection), + * __get_value(attr_injection)) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections_14NamedInjection___get_value(__pyx_v_attr_injection); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_10injections___get_value(((struct __pyx_obj_19dependency_injector_9providers_10injections_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "injections.pxd":94 + /* "injections.pxd":87 * for index in range(attributes_len): * attr_injection = attributes[index] * setattr(instance, # <<<<<<<<<<<<<< - * attr_injection.__get_name(), - * attr_injection.__get_value()) + * __get_name(attr_injection), + * __get_value(attr_injection)) */ - __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 94, __pyx_L1_error) + __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "injections.pxd":88 + /* "injections.pxd":81 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< @@ -5682,104 +5952,102 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10inject return __pyx_r; } -/* "callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) +/* "callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callables___call(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_positional_args = 0; PyObject *__pyx_v_keyword_args = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); + __Pyx_RefNannySetupContext("__call", 0); - /* "callables.pxd":32 + /* "callables.pxd":37 * - * positional_args = __provide_positional_args(args, - * self.__args, # <<<<<<<<<<<<<< - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, + * positional_args = __provide_positional_args(args, + * self.__args, # <<<<<<<<<<<<<< + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, */ __pyx_t_1 = __pyx_v_self->__pyx___args; __Pyx_INCREF(__pyx_t_1); - /* "callables.pxd":31 - * cdef dict keyword_args + /* "callables.pxd":36 + * cdef dict keyword_args * - * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< - * self.__args, - * self.__args_len) + * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< + * self.__args, + * self.__args_len) */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error) + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_10injections___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "callables.pxd":35 - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, - * self.__kwargs, # <<<<<<<<<<<<<< - * self.__kwargs_len) + /* "callables.pxd":40 + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, + * self.__kwargs, # <<<<<<<<<<<<<< + * self.__kwargs_len) * */ __pyx_t_2 = __pyx_v_self->__pyx___kwargs; __Pyx_INCREF(__pyx_t_2); - /* "callables.pxd":34 - * self.__args, - * self.__args_len) - * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< - * self.__kwargs, - * self.__kwargs_len) + /* "callables.pxd":39 + * self.__args, + * self.__args_len) + * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< + * self.__kwargs, + * self.__kwargs_len) */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 34, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_keyword_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "callables.pxd":38 - * self.__kwargs_len) - * - * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< - * + /* "callables.pxd":43 + * self.__kwargs_len) * + * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_positional_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(3, 38, __pyx_L1_error) + __PYX_ERR(2, 43, __pyx_L1_error) } if (unlikely(__pyx_v_keyword_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(3, 38, __pyx_L1_error) + __PYX_ERR(2, 43, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 38, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "callables.pxd":27 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "callables.pxd":32 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef tuple positional_args - * cdef dict keyword_args + * + * cdef inline object __call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef tuple positional_args + * cdef dict keyword_args */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("dependency_injector.providers.callables.Callable.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.callables.__call", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_positional_args); @@ -5789,81 +6057,83 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9callabl return __pyx_r; } -/* "factories.pxd":19 - * cpdef object _provide(self, tuple args, dict kwargs) +/* "factories.pxd":27 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance + * + * cdef inline object __call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef object instance * */ -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { +static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factories___call(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_instance = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__call", 0); - /* "factories.pxd":22 - * cdef object instance + /* "factories.pxd":30 + * cdef object instance * - * instance = self.__instantiator.__provide(args, kwargs) # <<<<<<<<<<<<<< + * instance = __call_callable(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<< * - * if self.__attributes_len > 0: + * if self.__attributes_len > 0: */ - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_9callables_8Callable___provide(__pyx_v_self->__pyx___instantiator, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_instance = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___instantiator); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_19dependency_injector_9providers_9callables___call(((struct __pyx_obj_19dependency_injector_9providers_9callables_Callable *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_instance = __pyx_t_2; + __pyx_t_2 = 0; - /* "factories.pxd":24 - * instance = self.__instantiator.__provide(args, kwargs) + /* "factories.pxd":32 + * instance = __call_callable(self.__instantiator, args, kwargs) * - * if self.__attributes_len > 0: # <<<<<<<<<<<<<< - * __inject_attributes(instance, - * self.__attributes, + * if self.__attributes_len > 0: # <<<<<<<<<<<<<< + * __inject_attributes(instance, + * self.__attributes, */ - __pyx_t_2 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0); - if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0); + if (__pyx_t_3) { - /* "factories.pxd":26 - * if self.__attributes_len > 0: - * __inject_attributes(instance, - * self.__attributes, # <<<<<<<<<<<<<< - * self.__attributes_len) + /* "factories.pxd":34 + * if self.__attributes_len > 0: + * __inject_attributes(instance, + * self.__attributes, # <<<<<<<<<<<<<< + * self.__attributes_len) * */ - __pyx_t_1 = __pyx_v_self->__pyx___attributes; - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self->__pyx___attributes; + __Pyx_INCREF(__pyx_t_2); - /* "factories.pxd":25 + /* "factories.pxd":33 * - * if self.__attributes_len > 0: - * __inject_attributes(instance, # <<<<<<<<<<<<<< - * self.__attributes, - * self.__attributes_len) + * if self.__attributes_len > 0: + * __inject_attributes(instance, # <<<<<<<<<<<<<< + * self.__attributes, + * self.__attributes_len) */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_10injections___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_10injections___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "factories.pxd":24 - * instance = self.__instantiator.__provide(args, kwargs) + /* "factories.pxd":32 + * instance = __call_callable(self.__instantiator, args, kwargs) * - * if self.__attributes_len > 0: # <<<<<<<<<<<<<< - * __inject_attributes(instance, - * self.__attributes, + * if self.__attributes_len > 0: # <<<<<<<<<<<<<< + * __inject_attributes(instance, + * self.__attributes, */ } - /* "factories.pxd":29 - * self.__attributes_len) - * - * return instance # <<<<<<<<<<<<<< + /* "factories.pxd":37 + * self.__attributes_len) * + * return instance # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); @@ -5871,544 +6141,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_9factori __pyx_r = __pyx_v_instance; goto __pyx_L0; - /* "factories.pxd":19 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "factories.pxd":27 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance + * + * cdef inline object __call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef object instance * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("dependency_injector.providers.factories.Factory.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_instance); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/providers/singletons.pxd":19 - * cpdef object _provide(self, tuple args, dict kwargs) - * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_9Singleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); - - /* "dependency_injector/providers/singletons.pxd":20 - * - * cdef inline object __provide(self, tuple args, dict kwargs): - * if self.__storage is None: # <<<<<<<<<<<<<< - * self.__storage = self.__instantiator.__provide(args, kwargs) - * return self.__storage - */ - __pyx_t_1 = (__pyx_v_self->__pyx___storage == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "dependency_injector/providers/singletons.pxd":21 - * cdef inline object __provide(self, tuple args, dict kwargs): - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) # <<<<<<<<<<<<<< - * return self.__storage - * - */ - __pyx_t_3 = __pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(__pyx_v_self->__pyx_base.__pyx___instantiator, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->__pyx___storage); - __Pyx_DECREF(__pyx_v_self->__pyx___storage); - __pyx_v_self->__pyx___storage = __pyx_t_3; - __pyx_t_3 = 0; - - /* "dependency_injector/providers/singletons.pxd":20 - * - * cdef inline object __provide(self, tuple args, dict kwargs): - * if self.__storage is None: # <<<<<<<<<<<<<< - * self.__storage = self.__instantiator.__provide(args, kwargs) - * return self.__storage - */ - } - - /* "dependency_injector/providers/singletons.pxd":22 - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) - * return self.__storage # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___storage); - __pyx_r = __pyx_v_self->__pyx___storage; - goto __pyx_L0; - - /* "dependency_injector/providers/singletons.pxd":19 - * cpdef object _provide(self, tuple args, dict kwargs) - * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("dependency_injector.providers.singletons.Singleton.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/providers/singletons.pxd":35 - * cpdef object _provide(self, tuple args, dict kwargs) - * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * with self.__lock: - * if self.__storage is None: - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - 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; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); - - /* "dependency_injector/providers/singletons.pxd":36 - * - * cdef inline object __provide(self, tuple args, dict kwargs): - * with self.__lock: # <<<<<<<<<<<<<< - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) - */ - /*with:*/ { - __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && 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); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L3_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L3_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - /*try:*/ { - - /* "dependency_injector/providers/singletons.pxd":37 - * cdef inline object __provide(self, tuple args, dict kwargs): - * with self.__lock: - * if self.__storage is None: # <<<<<<<<<<<<<< - * self.__storage = self.__instantiator.__provide(args, kwargs) - * return self.__storage - */ - __pyx_t_8 = (__pyx_v_self->__pyx___storage == Py_None); - __pyx_t_9 = (__pyx_t_8 != 0); - if (__pyx_t_9) { - - /* "dependency_injector/providers/singletons.pxd":38 - * with self.__lock: - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) # <<<<<<<<<<<<<< - * return self.__storage - * - */ - __pyx_t_2 = __pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(__pyx_v_self->__pyx_base.__pyx___instantiator, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->__pyx___storage); - __Pyx_DECREF(__pyx_v_self->__pyx___storage); - __pyx_v_self->__pyx___storage = __pyx_t_2; - __pyx_t_2 = 0; - - /* "dependency_injector/providers/singletons.pxd":37 - * cdef inline object __provide(self, tuple args, dict kwargs): - * with self.__lock: - * if self.__storage is None: # <<<<<<<<<<<<<< - * self.__storage = self.__instantiator.__provide(args, kwargs) - * return self.__storage - */ - } - - /* "dependency_injector/providers/singletons.pxd":36 - * - * cdef inline object __provide(self, tuple args, dict kwargs): - * with self.__lock: # <<<<<<<<<<<<<< - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) - */ - } - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L14_try_end; - __pyx_L7_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /*except:*/ { - __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadSafeSingleton.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 36, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__pyx_t_9 < 0) __PYX_ERR(0, 36, __pyx_L9_except_error) - __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); - if (__pyx_t_8) { - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4); - __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __PYX_ERR(0, 36, __pyx_L9_except_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L8_exception_handled; - } - __pyx_L9_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); - goto __pyx_L1_error; - __pyx_L8_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); - __pyx_L14_try_end:; - } - } - /*finally:*/ { - /*normal exit:*/{ - if (__pyx_t_1) { - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - goto __pyx_L6; - } - __pyx_L6:; - } - goto __pyx_L19; - __pyx_L3_error:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L1_error; - __pyx_L19:; - } - - /* "dependency_injector/providers/singletons.pxd":39 - * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) - * return self.__storage # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__pyx___storage); - __pyx_r = __pyx_v_self->__pyx___storage; - goto __pyx_L0; - - /* "dependency_injector/providers/singletons.pxd":35 - * cpdef object _provide(self, tuple args, dict kwargs) - * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * with self.__lock: - * if self.__storage is None: - */ - - /* function exit code */ - __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadSafeSingleton.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/providers/singletons.pxd":51 - * cpdef object _provide(self, tuple args, dict kwargs) - * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___provide(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - PyObject *__pyx_v_instance = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - __Pyx_RefNannySetupContext("__provide", 0); - - /* "dependency_injector/providers/singletons.pxd":54 - * cdef object instance - * - * try: # <<<<<<<<<<<<<< - * instance = self.__storage.instance - * except AttributeError: - */ - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "dependency_injector/providers/singletons.pxd":55 - * - * try: - * instance = self.__storage.instance # <<<<<<<<<<<<<< - * except AttributeError: - * instance = self.__instantiator.__provide(args, kwargs) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_instance = __pyx_t_4; - __pyx_t_4 = 0; - - /* "dependency_injector/providers/singletons.pxd":54 - * cdef object instance - * - * try: # <<<<<<<<<<<<<< - * instance = self.__storage.instance - * except AttributeError: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L13_try_end; - __pyx_L6_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "dependency_injector/providers/singletons.pxd":56 - * try: - * instance = self.__storage.instance - * except AttributeError: # <<<<<<<<<<<<<< - * instance = self.__instantiator.__provide(args, kwargs) - * self.__storage.instance = instance - */ - __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); - if (__pyx_t_5) { - __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadLocalSingleton.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 56, __pyx_L8_except_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "dependency_injector/providers/singletons.pxd":57 - * instance = self.__storage.instance - * except AttributeError: - * instance = self.__instantiator.__provide(args, kwargs) # <<<<<<<<<<<<<< - * self.__storage.instance = instance - * finally: - */ - __pyx_t_8 = __pyx_f_19dependency_injector_9providers_9factories_7Factory___provide(__pyx_v_self->__pyx_base.__pyx___instantiator, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L8_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_instance, __pyx_t_8); - __pyx_t_8 = 0; - - /* "dependency_injector/providers/singletons.pxd":58 - * except AttributeError: - * instance = self.__instantiator.__provide(args, kwargs) - * self.__storage.instance = instance # <<<<<<<<<<<<<< - * finally: - * return instance - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance, __pyx_v_instance) < 0) __PYX_ERR(0, 58, __pyx_L8_except_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L7_exception_handled; - } - goto __pyx_L8_except_error; - __pyx_L8_except_error:; - - /* "dependency_injector/providers/singletons.pxd":54 - * cdef object instance - * - * try: # <<<<<<<<<<<<<< - * instance = self.__storage.instance - * except AttributeError: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L4_error; - __pyx_L7_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_L13_try_end:; - } - } - - /* "dependency_injector/providers/singletons.pxd":60 - * self.__storage.instance = instance - * finally: - * return instance # <<<<<<<<<<<<<< - * - * - */ - /*finally:*/ { - /*normal exit:*/{ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_instance); - __pyx_r = __pyx_v_instance; - goto __pyx_L0; - } - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_9); - __Pyx_XGOTREF(__pyx_t_10); - __Pyx_XGOTREF(__pyx_t_11); - { - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_instance)) { __Pyx_RaiseUnboundLocalError("instance"); __PYX_ERR(0, 60, __pyx_L17_error) } - __Pyx_INCREF(__pyx_v_instance); - __pyx_r = __pyx_v_instance; - goto __pyx_L16_return; - } - __pyx_L16_return:; - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); - } - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - goto __pyx_L0; - __pyx_L17_error:; - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); - } - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - goto __pyx_L1_error; - } - } - - /* "dependency_injector/providers/singletons.pxd":51 - * cpdef object _provide(self, tuple args, dict kwargs) - * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("dependency_injector.providers.singletons.ThreadLocalSingleton.__provide", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.providers.factories.__call", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_instance); @@ -7198,11 +6943,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 56, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 49, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 61, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 196, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 54, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 47, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7212,14 +6957,14 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "dependency_injector/providers/singletons.pxd":36 - * - * cdef inline object __provide(self, tuple args, dict kwargs): + /* "dependency_injector/providers/singletons.pyx":312 + * cpdef object _provide(self, tuple args, dict kwargs): + * """Return single instance.""" * with self.__lock: # <<<<<<<<<<<<<< * if self.__storage is None: - * self.__storage = self.__instantiator.__provide(args, kwargs) + * self.__storage = __call_factory(self.__instantiator, */ - __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __Pyx_RefNannyFinishContext(); @@ -7230,7 +6975,7 @@ static int __Pyx_InitCachedConstants(void) { } static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; @@ -7260,24 +7005,24 @@ PyMODINIT_FUNC PyInit_singletons(void) } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_singletons(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __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) #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -7292,48 +7037,48 @@ PyMODINIT_FUNC PyInit_singletons(void) #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif - if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + 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(1, 1, __pyx_L1_error) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_dependency_injector__providers__singletons) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "dependency_injector.providers.singletons")) { - if (unlikely(PyDict_SetItemString(modules, "dependency_injector.providers.singletons", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + if (unlikely(PyDict_SetItemString(modules, "dependency_injector.providers.singletons", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - __pyx_ptype_19dependency_injector_9providers_4base_Provider = __Pyx_ImportType("dependency_injector.providers.base", "Provider", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Provider), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Provider)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_4base_Provider = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_Provider->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_Provider)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_4base_Provider = __Pyx_ImportType("dependency_injector.providers.base", "Provider", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Provider), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Provider)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_4base_Provider = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Provider*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_Provider->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_Provider)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_BaseSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_BaseSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_4base_Provider; __pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_4base_Provider; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 25, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 28, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10singletons_13BaseSingleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10singletons_13BaseSingleton___init__.doc = __pyx_doc_19dependency_injector_9providers_10singletons_13BaseSingleton___init__; @@ -7343,7 +7088,7 @@ PyMODINIT_FUNC PyInit_singletons(void) #endif #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 25, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 28, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10singletons_13BaseSingleton_2__str__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10singletons_13BaseSingleton_2__str__.doc = __pyx_doc_19dependency_injector_9providers_10singletons_13BaseSingleton_2__str__; @@ -7351,19 +7096,18 @@ PyMODINIT_FUNC PyInit_singletons(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton) < 0) __PYX_ERR(1, 25, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "BaseSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BaseSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton = &__pyx_type_19dependency_injector_9providers_10singletons_BaseSingleton; __pyx_vtabptr_19dependency_injector_9providers_10singletons_Singleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_Singleton; __pyx_vtable_19dependency_injector_9providers_10singletons_Singleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_Singleton.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_4base_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_10singletons_9Singleton__provide; - __pyx_vtable_19dependency_injector_9providers_10singletons_Singleton.__pyx___provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_10singletons_Singleton *, PyObject *, PyObject *))__pyx_f_19dependency_injector_9providers_10singletons_9Singleton___provide; __pyx_type_19dependency_injector_9providers_10singletons_Singleton.tp_base = __pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_Singleton) < 0) __PYX_ERR(1, 199, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_Singleton) < 0) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_Singleton.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_Singleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 199, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_Singleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 202, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10singletons_9Singleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10singletons_9Singleton___init__.doc = __pyx_doc_19dependency_injector_9providers_10singletons_9Singleton___init__; @@ -7371,27 +7115,26 @@ PyMODINIT_FUNC PyInit_singletons(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_Singleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_Singleton) < 0) __PYX_ERR(1, 199, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Singleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_Singleton) < 0) __PYX_ERR(1, 199, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_Singleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_Singleton) < 0) __PYX_ERR(0, 202, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Singleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_Singleton) < 0) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_Singleton = &__pyx_type_19dependency_injector_9providers_10singletons_Singleton; __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedSingleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_DelegatedSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_DelegatedSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_10singletons_Singleton; __pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_10singletons_Singleton; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton) < 0) __PYX_ERR(1, 257, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedSingleton) < 0) __PYX_ERR(1, 257, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "DelegatedSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton) < 0) __PYX_ERR(1, 257, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedSingleton) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DelegatedSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedSingleton = &__pyx_type_19dependency_injector_9providers_10singletons_DelegatedSingleton; __pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadSafeSingleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_ThreadSafeSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_4base_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton__provide; - __pyx_vtable_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.__pyx___provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadSafeSingleton *, PyObject *, PyObject *))__pyx_f_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___provide; __pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton) < 0) __PYX_ERR(1, 278, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 278, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 284, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___init__.doc = __pyx_doc_19dependency_injector_9providers_10singletons_19ThreadSafeSingleton___init__; @@ -7399,27 +7142,26 @@ PyMODINIT_FUNC PyInit_singletons(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadSafeSingleton) < 0) __PYX_ERR(1, 278, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ThreadSafeSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton) < 0) __PYX_ERR(1, 278, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadSafeSingleton) < 0) __PYX_ERR(0, 284, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ThreadSafeSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_ThreadSafeSingleton = &__pyx_type_19dependency_injector_9providers_10singletons_ThreadSafeSingleton; __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadSafeSingleton; __pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_10singletons_ThreadSafeSingleton; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(1, 309, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(1, 309, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "DelegatedThreadSafeSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(1, 309, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DelegatedThreadSafeSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton = &__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton; __pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadLocalSingleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_ThreadLocalSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_10singletons_BaseSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_4base_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton__provide; - __pyx_vtable_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.__pyx___provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_10singletons_ThreadLocalSingleton *, PyObject *, PyObject *))__pyx_f_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___provide; __pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 330, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 340, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___init__.doc = __pyx_doc_19dependency_injector_9providers_10singletons_20ThreadLocalSingleton___init__; @@ -7427,50 +7169,48 @@ PyMODINIT_FUNC PyInit_singletons(void) } } #endif - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadLocalSingleton) < 0) __PYX_ERR(1, 330, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ThreadLocalSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton) < 0) __PYX_ERR(1, 330, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadLocalSingleton) < 0) __PYX_ERR(0, 340, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ThreadLocalSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_ThreadLocalSingleton = &__pyx_type_19dependency_injector_9providers_10singletons_ThreadLocalSingleton; __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton = &__pyx_vtable_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton; __pyx_vtable_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_10singletons_ThreadLocalSingleton; __pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_10singletons_ThreadLocalSingleton; - if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(1, 375, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(1, 375, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "DelegatedThreadLocalSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(1, 375, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DelegatedThreadLocalSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton = &__pyx_type_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton; /*--- Type import code ---*/ - __pyx_ptype_19dependency_injector_9providers_4base_Object = __Pyx_ImportType("dependency_injector.providers.base", "Object", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Object), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Object)) __PYX_ERR(5, 15, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_4base_Object = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Object*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_Object->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_Object)) __PYX_ERR(5, 15, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_4base_Delegate = __Pyx_ImportType("dependency_injector.providers.base", "Delegate", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Delegate), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Delegate)) __PYX_ERR(5, 21, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_4base_Delegate = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Delegate*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_Delegate->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_Delegate)) __PYX_ERR(5, 21, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency = __Pyx_ImportType("dependency_injector.providers.base", "ExternalDependency", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_ExternalDependency), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency)) __PYX_ERR(5, 25, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency)) __PYX_ERR(5, 25, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_4base_OverridingContext = __Pyx_ImportType("dependency_injector.providers.base", "OverridingContext", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_OverridingContext)) __PYX_ERR(5, 29, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_Injection = __Pyx_ImportType("dependency_injector.providers.injections", "Injection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = __Pyx_ImportType("dependency_injector.providers.injections", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(2, 13, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection = (struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_PositionalInjection*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(2, 13, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = __Pyx_ImportType("dependency_injector.providers.injections", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(2, 25, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection = (struct __pyx_vtabstruct_19dependency_injector_9providers_10injections_NamedInjection*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(2, 25, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_9callables_Callable = __Pyx_ImportType("dependency_injector.providers.callables", "Callable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_Callable)) __PYX_ERR(3, 16, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_9callables_Callable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_Callable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable)) __PYX_ERR(3, 16, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = __Pyx_ImportType("dependency_injector.providers.callables", "DelegatedCallable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(3, 41, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(3, 41, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_9factories_Factory = __Pyx_ImportType("dependency_injector.providers.factories", "Factory", sizeof(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9factories_Factory)) __PYX_ERR(4, 11, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_9factories_Factory = (struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_Factory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9factories_Factory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9factories_Factory)) __PYX_ERR(4, 11, __pyx_L1_error) - __pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory = __Pyx_ImportType("dependency_injector.providers.factories", "DelegatedFactory", sizeof(struct __pyx_obj_19dependency_injector_9providers_9factories_DelegatedFactory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory)) __PYX_ERR(4, 32, __pyx_L1_error) - __pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory = (struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_DelegatedFactory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory)) __PYX_ERR(4, 32, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_4base_Object = __Pyx_ImportType("dependency_injector.providers.base", "Object", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Object), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Object)) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_4base_Object = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Object*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_Object->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_Object)) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_4base_Delegate = __Pyx_ImportType("dependency_injector.providers.base", "Delegate", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_Delegate), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_Delegate)) __PYX_ERR(4, 21, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_4base_Delegate = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_Delegate*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_Delegate->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_Delegate)) __PYX_ERR(4, 21, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency = __Pyx_ImportType("dependency_injector.providers.base", "ExternalDependency", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_ExternalDependency), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency)) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency = (struct __pyx_vtabstruct_19dependency_injector_9providers_4base_ExternalDependency*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_4base_ExternalDependency->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_4base_ExternalDependency)) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_4base_OverridingContext = __Pyx_ImportType("dependency_injector.providers.base", "OverridingContext", sizeof(struct __pyx_obj_19dependency_injector_9providers_4base_OverridingContext), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_4base_OverridingContext)) __PYX_ERR(4, 29, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_Injection = __Pyx_ImportType("dependency_injector.providers.injections", "Injection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_Injection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_Injection)) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection = __Pyx_ImportType("dependency_injector.providers.injections", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_PositionalInjection)) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection = __Pyx_ImportType("dependency_injector.providers.injections", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_10injections_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_10injections_NamedInjection)) __PYX_ERR(1, 20, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_9callables_Callable = __Pyx_ImportType("dependency_injector.providers.callables", "Callable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_Callable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_Callable)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_9callables_Callable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_Callable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_Callable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_Callable)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable = __Pyx_ImportType("dependency_injector.providers.callables", "DelegatedCallable", sizeof(struct __pyx_obj_19dependency_injector_9providers_9callables_DelegatedCallable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_9callables_DelegatedCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9callables_DelegatedCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9callables_DelegatedCallable)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_9factories_Factory = __Pyx_ImportType("dependency_injector.providers.factories", "Factory", sizeof(struct __pyx_obj_19dependency_injector_9providers_9factories_Factory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9factories_Factory)) __PYX_ERR(3, 14, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_9factories_Factory = (struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_Factory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9factories_Factory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9factories_Factory)) __PYX_ERR(3, 14, __pyx_L1_error) + __pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory = __Pyx_ImportType("dependency_injector.providers.factories", "DelegatedFactory", sizeof(struct __pyx_obj_19dependency_injector_9providers_9factories_DelegatedFactory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory)) __PYX_ERR(3, 23, __pyx_L1_error) + __pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory = (struct __pyx_vtabstruct_19dependency_injector_9providers_9factories_DelegatedFactory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_9factories_DelegatedFactory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_9factories_DelegatedFactory)) __PYX_ERR(3, 23, __pyx_L1_error) /*--- Variable import code ---*/ - __pyx_t_1 = __Pyx_ImportModule("dependency_injector.providers.utils"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr(__pyx_t_1, "CLASS_TYPES", (void **)&__pyx_vp_19dependency_injector_9providers_5utils_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_ImportModule("dependency_injector.providers.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "CLASS_TYPES", (void **)&__pyx_vp_19dependency_injector_9providers_5utils_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ - __pyx_t_2 = __Pyx_ImportModule("dependency_injector.providers.utils"); if (!__pyx_t_2) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_2, "represent_provider", (void (**)(void))&__pyx_f_19dependency_injector_9providers_5utils_represent_provider, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_2, "deepcopy", (void (**)(void))&__pyx_f_19dependency_injector_9providers_5utils_deepcopy, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_19dependency_injector_9providers_5utils_deepcopy *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportModule("dependency_injector.providers.utils"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_2, "represent_provider", (void (**)(void))&__pyx_f_19dependency_injector_9providers_5utils_represent_provider, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_2, "deepcopy", (void (**)(void))&__pyx_f_19dependency_injector_9providers_5utils_deepcopy, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_19dependency_injector_9providers_5utils_deepcopy *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "dependency_injector/providers/singletons.pyx":6 @@ -7480,9 +7220,9 @@ PyMODINIT_FUNC PyInit_singletons(void) * * from dependency_injector.errors import Error */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_3) < 0) __PYX_ERR(1, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dependency_injector/providers/singletons.pyx":8 @@ -7492,30 +7232,30 @@ PyMODINIT_FUNC PyInit_singletons(void) * * from .base cimport Provider */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Error); __Pyx_GIVEREF(__pyx_n_s_Error); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Error); - __pyx_t_4 = __Pyx_Import(__pyx_n_s_dependency_injector_errors, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) + __pyx_t_4 = __Pyx_Import(__pyx_n_s_dependency_injector_errors, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_3) < 0) __PYX_ERR(1, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_3) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/providers/singletons.pyx":18 + /* "dependency_injector/providers/singletons.pyx":21 * * * GLOBAL_LOCK = threading.RLock() # <<<<<<<<<<<<<< * """Global reentrant lock. * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 18, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 18, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -7529,52 +7269,52 @@ PyMODINIT_FUNC PyInit_singletons(void) } } if (__pyx_t_3) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLOBAL_LOCK, __pyx_t_4) < 0) __PYX_ERR(1, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLOBAL_LOCK, __pyx_t_4) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/providers/singletons.pyx":28 + /* "dependency_injector/providers/singletons.pyx":31 * """Base class of singleton providers.""" * * provided_type = None # <<<<<<<<<<<<<< * * def __init__(self, provides, *args, **kwargs): */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton->tp_dict, __pyx_n_s_provided_type, Py_None) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton->tp_dict, __pyx_n_s_provided_type, Py_None) < 0) __PYX_ERR(0, 31, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_10singletons_BaseSingleton); - /* "dependency_injector/providers/singletons.pyx":275 + /* "dependency_injector/providers/singletons.pyx":281 * """ * * __IS_DELEGATED__ = True # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 275, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 281, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedSingleton); - /* "dependency_injector/providers/singletons.pyx":327 + /* "dependency_injector/providers/singletons.pyx":337 * """ * * __IS_DELEGATED__ = True # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 327, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 337, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadSafeSingleton); - /* "dependency_injector/providers/singletons.pyx":393 + /* "dependency_injector/providers/singletons.pyx":411 * """ * * __IS_DELEGATED__ = True # <<<<<<<<<<<<<< */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 393, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(0, 411, __pyx_L1_error) PyType_Modified(__pyx_ptype_19dependency_injector_9providers_10singletons_DelegatedThreadLocalSingleton); /* "dependency_injector/providers/singletons.pyx":1 @@ -7582,16 +7322,16 @@ PyMODINIT_FUNC PyInit_singletons(void) * * Powered by Cython. */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/providers/singletons.pxd":51 - * cpdef object _provide(self, tuple args, dict kwargs) + /* "factories.pxd":27 * - * cdef inline object __provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<< - * cdef object instance + * + * cdef inline object __call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< + * cdef object instance * */ diff --git a/src/dependency_injector/providers/singletons.pxd b/src/dependency_injector/providers/singletons.pxd index 25f0b452..0c85d9c1 100644 --- a/src/dependency_injector/providers/singletons.pxd +++ b/src/dependency_injector/providers/singletons.pxd @@ -16,11 +16,6 @@ cdef class Singleton(BaseSingleton): cpdef object _provide(self, tuple args, dict kwargs) - cdef inline object __provide(self, tuple args, dict kwargs): - if self.__storage is None: - self.__storage = self.__instantiator.__provide(args, kwargs) - return self.__storage - cdef class DelegatedSingleton(Singleton): pass @@ -32,12 +27,6 @@ cdef class ThreadSafeSingleton(BaseSingleton): cpdef object _provide(self, tuple args, dict kwargs) - cdef inline object __provide(self, tuple args, dict kwargs): - with self.__lock: - if self.__storage is None: - self.__storage = self.__instantiator.__provide(args, kwargs) - return self.__storage - cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): pass @@ -48,17 +37,6 @@ cdef class ThreadLocalSingleton(BaseSingleton): cpdef object _provide(self, tuple args, dict kwargs) - cdef inline object __provide(self, tuple args, dict kwargs): - cdef object instance - - try: - instance = self.__storage.instance - except AttributeError: - instance = self.__instantiator.__provide(args, kwargs) - self.__storage.instance = instance - finally: - return instance - cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): pass diff --git a/src/dependency_injector/providers/singletons.pyx b/src/dependency_injector/providers/singletons.pyx index 44480e33..a28477b6 100644 --- a/src/dependency_injector/providers/singletons.pyx +++ b/src/dependency_injector/providers/singletons.pyx @@ -8,7 +8,10 @@ import threading from dependency_injector.errors import Error from .base cimport Provider -from .factories cimport Factory +from .factories cimport ( + Factory, + __call as __call_factory, +) from .utils cimport ( represent_provider, deepcopy, @@ -251,7 +254,10 @@ cdef class Singleton(BaseSingleton): cpdef object _provide(self, tuple args, dict kwargs): """Return single instance.""" - return self.__provide(args, kwargs) + if self.__storage is None: + self.__storage = __call_factory(self.__instantiator, + args, kwargs) + return self.__storage cdef class DelegatedSingleton(Singleton): @@ -303,7 +309,11 @@ cdef class ThreadSafeSingleton(BaseSingleton): cpdef object _provide(self, tuple args, dict kwargs): """Return single instance.""" - return self.__provide(args, kwargs) + with self.__lock: + if self.__storage is None: + self.__storage = __call_factory(self.__instantiator, + args, kwargs) + return self.__storage cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): @@ -369,7 +379,15 @@ cdef class ThreadLocalSingleton(BaseSingleton): cpdef object _provide(self, tuple args, dict kwargs): """Return single instance.""" - return self.__provide(args, kwargs) + cdef object instance + + try: + instance = self.__storage.instance + except AttributeError: + instance = __call_factory(self.__instantiator, args, kwargs) + self.__storage.instance = instance + finally: + return instance cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton):