From 7840e2a13e80d8c2cbc93ec1c31d085da52f29ae Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Sun, 26 Mar 2017 22:38:26 +0300 Subject: [PATCH] Add types declaration for containers --- src/dependency_injector/containers.c | 1687 ++++++++++++------------ src/dependency_injector/containers.pyx | 20 +- 2 files changed, 857 insertions(+), 850 deletions(-) diff --git a/src/dependency_injector/containers.c b/src/dependency_injector/containers.c index ebadb3b0..0e9b81cf 100644 --- a/src/dependency_injector/containers.c +++ b/src/dependency_injector/containers.c @@ -939,9 +939,9 @@ struct __pyx_obj_19dependency_injector_9providers_NamedInjection { /* "dependency_injector/containers.pyx":141 * """Declarative inversion of control container meta class.""" * - * def __new__(mcs, class_name, bases, attributes): # <<<<<<<<<<<<<< + * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" - * cls_providers = tuple((name, provider) + * cdef tuple cls_providers */ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct____new__ { PyObject_HEAD @@ -950,9 +950,9 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct____new__ }; -/* "dependency_injector/containers.pyx":143 - * def __new__(mcs, class_name, bases, attributes): - * """Declarative container class factory.""" +/* "dependency_injector/containers.pyx":147 + * cdef type cls + * * cls_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) @@ -968,7 +968,7 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_genexpr }; -/* "dependency_injector/containers.pyx":147 +/* "dependency_injector/containers.pyx":151 * if isinstance(provider, Provider)) * * inherited_providers = tuple((name, provider) # <<<<<<<<<<<<<< @@ -983,14 +983,13 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2_genexpr PyObject *__pyx_v_provider; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; - PyObject *(*__pyx_t_2)(PyObject *); - PyObject *__pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); }; -/* "dependency_injector/containers.pyx":316 +/* "dependency_injector/containers.pyx":320 * * * def override(object container): # <<<<<<<<<<<<<< @@ -1003,7 +1002,7 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_overrid }; -/* "dependency_injector/containers.pyx":333 +/* "dependency_injector/containers.pyx":337 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -1955,7 +1954,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_10reset_override(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___3genexpr(PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mcs, PyObject *__pyx_v_class_name, PyObject *__pyx_v_bases, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__(CYTHON_UNUSED PyObject *__pyx_self, PyTypeObject *__pyx_v_mcs, PyObject *__pyx_v_class_name, PyObject *__pyx_v_bases, PyObject *__pyx_v_attributes); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_2__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_4__delattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContainer___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ @@ -2496,7 +2495,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * del self.providers[name] * super(DynamicContainer, self).__delattr__(name) # <<<<<<<<<<<<<< * - * def override(self, overriding): + * def override(self, object overriding): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -2586,7 +2585,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /* "dependency_injector/containers.pyx":91 * super(DynamicContainer, self).__delattr__(name) * - * def override(self, overriding): # <<<<<<<<<<<<<< + * def override(self, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ @@ -3124,7 +3123,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /* "dependency_injector/containers.pyx":91 * super(DynamicContainer, self).__delattr__(name) * - * def override(self, overriding): # <<<<<<<<<<<<<< + * def override(self, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ @@ -3718,9 +3717,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /* "dependency_injector/containers.pyx":141 * """Declarative inversion of control container meta class.""" * - * def __new__(mcs, class_name, bases, attributes): # <<<<<<<<<<<<<< + * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" - * cls_providers = tuple((name, provider) + * cdef tuple cls_providers */ /* Python wrapper */ @@ -3728,7 +3727,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai static char __pyx_doc_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__[] = "Declarative container class factory."; static PyMethodDef __pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_1__new__ = {"__new__", (PyCFunction)__pyx_pw_19dependency_injector_10containers_29DeclarativeContainerMetaClass_1__new__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__}; static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContainerMetaClass_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_mcs = 0; + PyTypeObject *__pyx_v_mcs = 0; PyObject *__pyx_v_class_name = 0; PyObject *__pyx_v_bases = 0; PyObject *__pyx_v_attributes = 0; @@ -3781,10 +3780,10 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } - __pyx_v_mcs = values[0]; - __pyx_v_class_name = values[1]; - __pyx_v_bases = values[2]; - __pyx_v_attributes = values[3]; + __pyx_v_mcs = ((PyTypeObject*)values[0]); + __pyx_v_class_name = ((PyObject*)values[1]); + __pyx_v_bases = ((PyObject*)values[2]); + __pyx_v_attributes = ((PyObject*)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -3794,17 +3793,25 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mcs), (&PyType_Type), 1, "mcs", 1))) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_name), (&PyString_Type), 1, "class_name", 1))) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bases), (&PyTuple_Type), 1, "bases", 1))) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attributes), (&PyDict_Type), 1, "attributes", 1))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__(__pyx_self, __pyx_v_mcs, __pyx_v_class_name, __pyx_v_bases, __pyx_v_attributes); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "dependency_injector/containers.pyx":143 - * def __new__(mcs, class_name, bases, attributes): - * """Declarative container class factory.""" +/* "dependency_injector/containers.pyx":147 + * cdef type cls + * * cls_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) @@ -3819,7 +3826,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 143, __pyx_L1_error) + __PYX_ERR(0, 147, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -3827,7 +3834,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DeclarativeContainerMetaClass, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DeclarativeContainerMetaClass, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -3867,21 +3874,21 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error) - /* "dependency_injector/containers.pyx":144 - * """Declarative container class factory.""" + /* "dependency_injector/containers.pyx":148 + * * cls_providers = tuple((name, provider) * for name, provider in six.iteritems(attributes) # <<<<<<<<<<<<<< * if isinstance(provider, Provider)) * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes)) { __Pyx_RaiseClosureNameError("attributes"); __PYX_ERR(0, 144, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes)) { __Pyx_RaiseClosureNameError("attributes"); __PYX_ERR(0, 148, __pyx_L1_error) } __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); @@ -3893,13 +3900,13 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __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, 148, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -3907,19 +3914,19 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __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, 148, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attributes); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -3929,9 +3936,9 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -3939,17 +3946,17 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -3959,7 +3966,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai 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, 144, __pyx_L1_error) + else __PYX_ERR(0, 148, __pyx_L1_error) } break; } @@ -3975,7 +3982,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 148, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -3988,15 +3995,15 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #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(0, 144, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __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; @@ -4004,7 +4011,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; @@ -4012,7 +4019,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 148, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_name); @@ -4024,7 +4031,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":145 + /* "dependency_injector/containers.pyx":149 * cls_providers = tuple((name, provider) * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) # <<<<<<<<<<<<<< @@ -4035,14 +4042,14 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { - /* "dependency_injector/containers.pyx":143 - * def __new__(mcs, class_name, bases, attributes): - * """Declarative container class factory.""" + /* "dependency_injector/containers.pyx":147 + * cdef type cls + * * cls_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); @@ -4067,9 +4074,9 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_XGOTREF(__pyx_t_3); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error) - /* "dependency_injector/containers.pyx":145 + /* "dependency_injector/containers.pyx":149 * cls_providers = tuple((name, provider) * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) # <<<<<<<<<<<<<< @@ -4078,8 +4085,8 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":144 - * """Declarative container class factory.""" + /* "dependency_injector/containers.pyx":148 + * * cls_providers = tuple((name, provider) * for name, provider in six.iteritems(attributes) # <<<<<<<<<<<<<< * if isinstance(provider, Provider)) @@ -4089,9 +4096,9 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dependency_injector/containers.pyx":143 - * def __new__(mcs, class_name, bases, attributes): - * """Declarative container class factory.""" + /* "dependency_injector/containers.pyx":147 + * cdef type cls + * * cls_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) @@ -4116,7 +4123,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai } static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___5generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "dependency_injector/containers.pyx":147 +/* "dependency_injector/containers.pyx":151 * if isinstance(provider, Provider)) * * inherited_providers = tuple((name, provider) # <<<<<<<<<<<<<< @@ -4133,7 +4140,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 147, __pyx_L1_error) + __PYX_ERR(0, 151, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -4141,7 +4148,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___5generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DeclarativeContainerMetaClass, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___5generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DeclarativeContainerMetaClass, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4163,18 +4170,17 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; - int __pyx_t_7; + 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; - Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); PyObject *(*__pyx_t_13)(PyObject *); - PyObject *(*__pyx_t_14)(PyObject *); __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("None", 0); switch (__pyx_generator->resume_label) { @@ -4185,224 +4191,198 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) - /* "dependency_injector/containers.pyx":148 + /* "dependency_injector/containers.pyx":152 * * inherited_providers = tuple((name, provider) * for base in bases if is_container( # <<<<<<<<<<<<<< * base) and base is not DynamicContainer * for name, provider in six.iteritems( */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases)) { __Pyx_RaiseClosureNameError("bases"); __PYX_ERR(0, 148, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases)) { __Pyx_RaiseClosureNameError("bases"); __PYX_ERR(0, 152, __pyx_L1_error) } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 152, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bases; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 148, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_base); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_base, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_base, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":149 + /* "dependency_injector/containers.pyx":153 * inherited_providers = tuple((name, provider) * for base in bases if is_container( * base) and base is not DynamicContainer # <<<<<<<<<<<<<< * for name, provider in six.iteritems( * base.cls_providers)) */ - __pyx_t_6 = (__pyx_f_19dependency_injector_10containers_is_container(__pyx_cur_scope->__pyx_v_base, 0) != 0); - if (__pyx_t_6) { + __pyx_t_5 = (__pyx_f_19dependency_injector_10containers_is_container(__pyx_cur_scope->__pyx_v_base, 0) != 0); + if (__pyx_t_5) { } else { - __pyx_t_5 = __pyx_t_6; + __pyx_t_4 = __pyx_t_5; goto __pyx_L7_bool_binop_done; } - /* "dependency_injector/containers.pyx":150 + /* "dependency_injector/containers.pyx":154 * for base in bases if is_container( * base) and base is not DynamicContainer * for name, provider in six.iteritems( # <<<<<<<<<<<<<< * base.cls_providers)) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = (__pyx_cur_scope->__pyx_v_base != __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_cur_scope->__pyx_v_base != __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":149 + /* "dependency_injector/containers.pyx":153 * inherited_providers = tuple((name, provider) * for base in bases if is_container( * base) and base is not DynamicContainer # <<<<<<<<<<<<<< * for name, provider in six.iteritems( * base.cls_providers)) */ - __pyx_t_7 = (__pyx_t_6 != 0); - __pyx_t_5 = __pyx_t_7; + __pyx_t_6 = (__pyx_t_5 != 0); + __pyx_t_4 = __pyx_t_6; __pyx_L7_bool_binop_done:; - /* "dependency_injector/containers.pyx":148 + /* "dependency_injector/containers.pyx":152 * * inherited_providers = tuple((name, provider) * for base in bases if is_container( # <<<<<<<<<<<<<< * base) and base is not DynamicContainer * for name, provider in six.iteritems( */ - if (__pyx_t_5) { + if (__pyx_t_4) { - /* "dependency_injector/containers.pyx":150 + /* "dependency_injector/containers.pyx":154 * for base in bases if is_container( * base) and base is not DynamicContainer * for name, provider in six.iteritems( # <<<<<<<<<<<<<< * base.cls_providers)) * */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":151 + /* "dependency_injector/containers.pyx":155 * base) and base is not DynamicContainer * for name, provider in six.iteritems( * base.cls_providers)) # <<<<<<<<<<<<<< * * attributes['cls_providers'] = dict(cls_providers) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_base, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_base, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_8, function); } } - if (!__pyx_t_10) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_4); + if (!__pyx_t_9) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_9)) { - PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { - PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":150 + /* "dependency_injector/containers.pyx":154 * for base in bases if is_container( * base) and base is not DynamicContainer * for name, provider in six.iteritems( # <<<<<<<<<<<<<< * base.cls_providers)) * */ - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0; - __pyx_t_13 = NULL; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 154, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { - if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break; + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif } else { - if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_4 = __pyx_t_13(__pyx_t_9); - if (unlikely(!__pyx_t_4)) { + __pyx_t_3 = __pyx_t_12(__pyx_t_8); + if (unlikely(!__pyx_t_3)) { 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, 150, __pyx_L1_error) + else __PYX_ERR(0, 154, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); } - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else @@ -4411,80 +4391,79 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 150, __pyx_L1_error) + __PYX_ERR(0, 154, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_11 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + __pyx_t_10 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_10); if (unlikely(!__pyx_t_11)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_10), 2) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + index = 1; __pyx_t_7 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 150, __pyx_L1_error) + __PYX_ERR(0, 154, __pyx_L1_error) __pyx_L12_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_name); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_name, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_name, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_provider); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_provider, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_provider, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":147 + /* "dependency_injector/containers.pyx":151 * if isinstance(provider, Provider)) * * inherited_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for base in bases if is_container( * base) and base is not DynamicContainer */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_name); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_provider); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_provider); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_provider); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_provider); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; - __Pyx_XGIVEREF(__pyx_t_9); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; + __Pyx_XGIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_11; __pyx_cur_scope->__pyx_t_4 = __pyx_t_12; - __pyx_cur_scope->__pyx_t_5 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); /* return from generator, yielding value */ @@ -4495,15 +4474,14 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; - __pyx_cur_scope->__pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_11 = __pyx_cur_scope->__pyx_t_3; __pyx_t_12 = __pyx_cur_scope->__pyx_t_4; - __pyx_t_13 = __pyx_cur_scope->__pyx_t_5; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) - /* "dependency_injector/containers.pyx":150 + /* "dependency_injector/containers.pyx":154 * for base in bases if is_container( * base) and base is not DynamicContainer * for name, provider in six.iteritems( # <<<<<<<<<<<<<< @@ -4511,9 +4489,9 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai * */ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":148 + /* "dependency_injector/containers.pyx":152 * * inherited_providers = tuple((name, provider) * for base in bases if is_container( # <<<<<<<<<<<<<< @@ -4525,7 +4503,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dependency_injector/containers.pyx":147 + /* "dependency_injector/containers.pyx":151 * if isinstance(provider, Provider)) * * inherited_providers = tuple((name, provider) # <<<<<<<<<<<<<< @@ -4538,11 +4516,11 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; @@ -4555,16 +4533,16 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai /* "dependency_injector/containers.pyx":141 * """Declarative inversion of control container meta class.""" * - * def __new__(mcs, class_name, bases, attributes): # <<<<<<<<<<<<<< + * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" - * cls_providers = tuple((name, provider) + * cdef tuple cls_providers */ -static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mcs, PyObject *__pyx_v_class_name, PyObject *__pyx_v_bases, PyObject *__pyx_v_attributes) { +static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass___new__(CYTHON_UNUSED PyObject *__pyx_self, PyTypeObject *__pyx_v_mcs, PyObject *__pyx_v_class_name, PyObject *__pyx_v_bases, PyObject *__pyx_v_attributes) { struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct____new__ *__pyx_cur_scope; - PyObject *__pyx_v_cls_providers = NULL; - PyObject *__pyx_v_inherited_providers = NULL; - PyObject *__pyx_v_cls = NULL; + PyObject *__pyx_v_cls_providers = 0; + PyObject *__pyx_v_inherited_providers = 0; + PyTypeObject *__pyx_v_cls = 0; PyObject *__pyx_v_provider = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4592,100 +4570,112 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_cur_scope->__pyx_v_attributes); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_attributes); - /* "dependency_injector/containers.pyx":143 - * def __new__(mcs, class_name, bases, attributes): - * """Declarative container class factory.""" + /* "dependency_injector/containers.pyx":147 + * cdef type cls + * * cls_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(attributes) * if isinstance(provider, Provider)) */ - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_2 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cls_providers = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":147 + /* "dependency_injector/containers.pyx":151 * if isinstance(provider, Provider)) * * inherited_providers = tuple((name, provider) # <<<<<<<<<<<<<< * for base in bases if is_container( * base) and base is not DynamicContainer */ - __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7__new___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_inherited_providers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":153 + /* "dependency_injector/containers.pyx":157 * base.cls_providers)) * * attributes['cls_providers'] = dict(cls_providers) # <<<<<<<<<<<<<< * attributes['inherited_providers'] = dict(inherited_providers) * attributes['providers'] = dict(cls_providers + inherited_providers) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_cls_providers); __Pyx_GIVEREF(__pyx_v_cls_providers); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cls_providers); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_attributes, __pyx_n_s_cls_providers, __pyx_t_2) < 0)) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(__pyx_cur_scope->__pyx_v_attributes == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 157, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_attributes, __pyx_n_s_cls_providers, __pyx_t_2) < 0)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":154 + /* "dependency_injector/containers.pyx":158 * * attributes['cls_providers'] = dict(cls_providers) * attributes['inherited_providers'] = dict(inherited_providers) # <<<<<<<<<<<<<< * attributes['providers'] = dict(cls_providers + inherited_providers) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_inherited_providers); __Pyx_GIVEREF(__pyx_v_inherited_providers); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_inherited_providers); - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_attributes, __pyx_n_s_inherited_providers, __pyx_t_1) < 0)) __PYX_ERR(0, 154, __pyx_L1_error) + if (unlikely(__pyx_cur_scope->__pyx_v_attributes == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 158, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_attributes, __pyx_n_s_inherited_providers, __pyx_t_1) < 0)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":155 + /* "dependency_injector/containers.pyx":159 * attributes['cls_providers'] = dict(cls_providers) * attributes['inherited_providers'] = dict(inherited_providers) * attributes['providers'] = dict(cls_providers + inherited_providers) # <<<<<<<<<<<<<< * - * cls = type.__new__(mcs, class_name, bases, attributes) + * cls = type.__new__(mcs, class_name, bases, attributes) */ - __pyx_t_1 = PyNumber_Add(__pyx_v_cls_providers, __pyx_v_inherited_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_cls_providers, __pyx_v_inherited_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_attributes, __pyx_n_s_providers, __pyx_t_1) < 0)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(__pyx_cur_scope->__pyx_v_attributes == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 159, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_attributes, __pyx_n_s_providers, __pyx_t_1) < 0)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":157 + /* "dependency_injector/containers.pyx":161 * attributes['providers'] = dict(cls_providers + inherited_providers) * - * cls = type.__new__(mcs, class_name, bases, attributes) # <<<<<<<<<<<<<< + * cls = type.__new__(mcs, class_name, bases, attributes) # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.providers): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -4701,29 +4691,29 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_mcs, __pyx_v_class_name, __pyx_cur_scope->__pyx_v_bases, __pyx_cur_scope->__pyx_v_attributes}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_mcs), __pyx_v_class_name, __pyx_cur_scope->__pyx_v_bases, __pyx_cur_scope->__pyx_v_attributes}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_mcs, __pyx_v_class_name, __pyx_cur_scope->__pyx_v_bases, __pyx_cur_scope->__pyx_v_attributes}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_mcs), __pyx_v_class_name, __pyx_cur_scope->__pyx_v_bases, __pyx_cur_scope->__pyx_v_attributes}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } - __Pyx_INCREF(__pyx_v_mcs); - __Pyx_GIVEREF(__pyx_v_mcs); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_mcs); + __Pyx_INCREF(((PyObject *)__pyx_v_mcs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_mcs)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_mcs)); __Pyx_INCREF(__pyx_v_class_name); __Pyx_GIVEREF(__pyx_v_class_name); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_class_name); @@ -4733,28 +4723,31 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_cur_scope->__pyx_v_attributes); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_attributes); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_cur_scope->__pyx_v_attributes); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_cls = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_cls = ((PyTypeObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":159 - * cls = type.__new__(mcs, class_name, bases, attributes) + /* "dependency_injector/containers.pyx":163 + * cls = type.__new__(mcs, class_name, bases, attributes) * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * _check_provider_type(cls, provider) * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); @@ -4766,97 +4759,97 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_5); - if (unlikely(!__pyx_t_1)) { + __pyx_t_2 = __pyx_t_8(__pyx_t_5); + if (unlikely(!__pyx_t_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, 159, __pyx_L1_error) + else __PYX_ERR(0, 163, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_2); + __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":160 + /* "dependency_injector/containers.pyx":164 * * for provider in six.itervalues(cls.providers): * _check_provider_type(cls, provider) # <<<<<<<<<<<<<< * * return cls */ - __pyx_t_1 = __pyx_f_19dependency_injector_10containers__check_provider_type(__pyx_v_cls, __pyx_v_provider, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_f_19dependency_injector_10containers__check_provider_type(((PyObject *)__pyx_v_cls), __pyx_v_provider, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":159 - * cls = type.__new__(mcs, class_name, bases, attributes) + /* "dependency_injector/containers.pyx":163 + * cls = type.__new__(mcs, class_name, bases, attributes) * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * _check_provider_type(cls, provider) @@ -4865,24 +4858,24 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/containers.pyx":162 + /* "dependency_injector/containers.pyx":166 * _check_provider_type(cls, provider) * * return cls # <<<<<<<<<<<<<< * - * def __setattr__(cls, name, value): + * def __setattr__(cls, str name, object value): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_cls); - __pyx_r = __pyx_v_cls; + __Pyx_INCREF(((PyObject *)__pyx_v_cls)); + __pyx_r = ((PyObject *)__pyx_v_cls); goto __pyx_L0; /* "dependency_injector/containers.pyx":141 * """Declarative inversion of control container meta class.""" * - * def __new__(mcs, class_name, bases, attributes): # <<<<<<<<<<<<<< + * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" - * cls_providers = tuple((name, provider) + * cdef tuple cls_providers */ /* function exit code */ @@ -4905,10 +4898,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":164 +/* "dependency_injector/containers.pyx":168 * return cls * - * def __setattr__(cls, name, value): # <<<<<<<<<<<<<< + * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< * """Set class attribute. * */ @@ -4945,16 +4938,16 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 164, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 168, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 164, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 168, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 164, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4964,20 +4957,25 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_cls = values[0]; - __pyx_v_name = values[1]; + __pyx_v_name = ((PyObject*)values[1]); __pyx_v_value = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 164, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainerMetaClass.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_2__setattr__(__pyx_self, __pyx_v_cls, __pyx_v_name, __pyx_v_value); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4994,7 +4992,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__setattr__", 0); - /* "dependency_injector/containers.pyx":178 + /* "dependency_injector/containers.pyx":182 * :rtype: None * """ * if isinstance(value, Provider): # <<<<<<<<<<<<<< @@ -5005,42 +5003,42 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dependency_injector/containers.pyx":179 + /* "dependency_injector/containers.pyx":183 * """ * if isinstance(value, Provider): * _check_provider_type(cls, value) # <<<<<<<<<<<<<< * cls.providers[name] = value * cls.cls_providers[name] = value */ - __pyx_t_3 = __pyx_f_19dependency_injector_10containers__check_provider_type(__pyx_v_cls, __pyx_v_value, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_3 = __pyx_f_19dependency_injector_10containers__check_provider_type(__pyx_v_cls, __pyx_v_value, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":180 + /* "dependency_injector/containers.pyx":184 * if isinstance(value, Provider): * _check_provider_type(cls, value) * cls.providers[name] = value # <<<<<<<<<<<<<< * cls.cls_providers[name] = value * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 180, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":181 + /* "dependency_injector/containers.pyx":185 * _check_provider_type(cls, value) * cls.providers[name] = value * cls.cls_providers[name] = value # <<<<<<<<<<<<<< * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":178 + /* "dependency_injector/containers.pyx":182 * :rtype: None * """ * if isinstance(value, Provider): # <<<<<<<<<<<<<< @@ -5049,16 +5047,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":182 + /* "dependency_injector/containers.pyx":186 * cls.providers[name] = value * cls.cls_providers[name] = value * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) # <<<<<<<<<<<<<< * - * def __delattr__(cls, name): + * def __delattr__(cls, str name): */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); @@ -5066,10 +5064,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GIVEREF(__pyx_v_cls); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_cls); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -5087,7 +5085,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -5095,13 +5093,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5112,17 +5110,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":164 + /* "dependency_injector/containers.pyx":168 * return cls * - * def __setattr__(cls, name, value): # <<<<<<<<<<<<<< + * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< * """Set class attribute. * */ @@ -5143,10 +5141,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":184 +/* "dependency_injector/containers.pyx":188 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * - * def __delattr__(cls, name): # <<<<<<<<<<<<<< + * def __delattr__(cls, str name): # <<<<<<<<<<<<<< * """Delete class attribute. * */ @@ -5181,11 +5179,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, 1); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, 1); __PYX_ERR(0, 188, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__delattr__") < 0)) __PYX_ERR(0, 184, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__delattr__") < 0)) __PYX_ERR(0, 188, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5194,19 +5192,24 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_cls = values[0]; - __pyx_v_name = values[1]; + __pyx_v_name = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 188, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainerMetaClass.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_4__delattr__(__pyx_self, __pyx_v_cls, __pyx_v_name); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5223,16 +5226,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__delattr__", 0); - /* "dependency_injector/containers.pyx":195 + /* "dependency_injector/containers.pyx":199 * :rtype: None * """ * if name in cls.providers and name in cls.cls_providers: # <<<<<<<<<<<<<< * del cls.providers[name] * del cls.cls_providers[name] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { @@ -5240,40 +5243,40 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "dependency_injector/containers.pyx":196 + /* "dependency_injector/containers.pyx":200 * """ * if name in cls.providers and name in cls.cls_providers: * del cls.providers[name] # <<<<<<<<<<<<<< * del cls.cls_providers[name] * super(DeclarativeContainerMetaClass, cls).__delattr__(name) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 196, __pyx_L1_error) + if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":197 + /* "dependency_injector/containers.pyx":201 * if name in cls.providers and name in cls.cls_providers: * del cls.providers[name] * del cls.cls_providers[name] # <<<<<<<<<<<<<< * super(DeclarativeContainerMetaClass, cls).__delattr__(name) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 197, __pyx_L1_error) + if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":195 + /* "dependency_injector/containers.pyx":199 * :rtype: None * """ * if name in cls.providers and name in cls.cls_providers: # <<<<<<<<<<<<<< @@ -5282,16 +5285,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":198 + /* "dependency_injector/containers.pyx":202 * del cls.providers[name] * del cls.cls_providers[name] * super(DeclarativeContainerMetaClass, cls).__delattr__(name) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); @@ -5299,10 +5302,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GIVEREF(__pyx_v_cls); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_cls); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_delattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_delattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5316,13 +5319,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_name}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -5330,19 +5333,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_name}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -5350,10 +5353,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":184 + /* "dependency_injector/containers.pyx":188 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * - * def __delattr__(cls, name): # <<<<<<<<<<<<<< + * def __delattr__(cls, str name): # <<<<<<<<<<<<<< * """Delete class attribute. * */ @@ -5374,7 +5377,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":252 +/* "dependency_injector/containers.pyx":256 * """ * * def __new__(cls, *args, **kwargs): # <<<<<<<<<<<<<< @@ -5425,7 +5428,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai } 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, "__new__") < 0)) __PYX_ERR(0, 252, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__new__") < 0)) __PYX_ERR(0, 256, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -5436,7 +5439,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 252, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 256, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -5470,48 +5473,48 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai int __pyx_t_9; __Pyx_RefNannySetupContext("__new__", 0); - /* "dependency_injector/containers.pyx":258 + /* "dependency_injector/containers.pyx":262 * :rtype: :py:class:`DynamicContainer` * """ * container = cls.instance_type(*args, **kwargs) # <<<<<<<<<<<<<< * container.provider_type = cls.provider_type * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_instance_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_instance_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_container = __pyx_t_2; __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":259 + /* "dependency_injector/containers.pyx":263 * """ * container = cls.instance_type(*args, **kwargs) * container.provider_type = cls.provider_type # <<<<<<<<<<<<<< * * for name, provider in six.iteritems(deepcopy(cls.providers)): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_provider_type, __pyx_t_2) < 0) __PYX_ERR(0, 259, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_provider_type, __pyx_t_2) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":261 + /* "dependency_injector/containers.pyx":265 * container.provider_type = cls.provider_type * * for name, provider in six.iteritems(deepcopy(cls.providers)): # <<<<<<<<<<<<<< * setattr(container, name, provider) * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -5525,14 +5528,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __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, 265, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5541,20 +5544,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __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, 265, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __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, 261, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -5564,9 +5567,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -5574,17 +5577,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 265, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 265, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -5594,7 +5597,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai 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, 261, __pyx_L1_error) + else __PYX_ERR(0, 265, __pyx_L1_error) } break; } @@ -5610,7 +5613,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 261, __pyx_L1_error) + __PYX_ERR(0, 265, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5623,15 +5626,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; @@ -5639,7 +5642,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 261, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 265, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_unpacking_done; @@ -5647,7 +5650,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 261, __pyx_L1_error) + __PYX_ERR(0, 265, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); @@ -5655,16 +5658,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":262 + /* "dependency_injector/containers.pyx":266 * * for name, provider in six.iteritems(deepcopy(cls.providers)): * setattr(container, name, provider) # <<<<<<<<<<<<<< * * return container */ - __pyx_t_9 = PyObject_SetAttr(__pyx_v_container, __pyx_v_name, __pyx_v_provider); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_9 = PyObject_SetAttr(__pyx_v_container, __pyx_v_name, __pyx_v_provider); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 266, __pyx_L1_error) - /* "dependency_injector/containers.pyx":261 + /* "dependency_injector/containers.pyx":265 * container.provider_type = cls.provider_type * * for name, provider in six.iteritems(deepcopy(cls.providers)): # <<<<<<<<<<<<<< @@ -5674,7 +5677,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":264 + /* "dependency_injector/containers.pyx":268 * setattr(container, name, provider) * * return container # <<<<<<<<<<<<<< @@ -5686,7 +5689,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_r = __pyx_v_container; goto __pyx_L0; - /* "dependency_injector/containers.pyx":252 + /* "dependency_injector/containers.pyx":256 * """ * * def __new__(cls, *args, **kwargs): # <<<<<<<<<<<<<< @@ -5712,10 +5715,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":267 +/* "dependency_injector/containers.pyx":271 * * @classmethod - * def override(cls, overriding): # <<<<<<<<<<<<<< + * def override(cls, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ @@ -5750,11 +5753,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overriding)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, 1); __PYX_ERR(0, 267, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, 1); __PYX_ERR(0, 271, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "override") < 0)) __PYX_ERR(0, 267, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "override") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5767,7 +5770,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 267, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainer.override", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5802,35 +5805,35 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai int __pyx_t_15; __Pyx_RefNannySetupContext("override", 0); - /* "dependency_injector/containers.pyx":278 + /* "dependency_injector/containers.pyx":282 * :rtype: None * """ * if issubclass(cls, overriding): # <<<<<<<<<<<<<< * raise Error('Container {0} could not be overridden ' * 'with itself or its subclasses'.format(cls)) */ - __pyx_t_1 = PyObject_IsSubclass(__pyx_v_cls, __pyx_v_overriding); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_1 = PyObject_IsSubclass(__pyx_v_cls, __pyx_v_overriding); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 282, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dependency_injector/containers.pyx":279 + /* "dependency_injector/containers.pyx":283 * """ * if issubclass(cls, overriding): * raise Error('Container {0} could not be overridden ' # <<<<<<<<<<<<<< * 'with itself or its subclasses'.format(cls)) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "dependency_injector/containers.pyx":280 + /* "dependency_injector/containers.pyx":284 * if issubclass(cls, overriding): * raise Error('Container {0} could not be overridden ' * 'with itself or its subclasses'.format(cls)) # <<<<<<<<<<<<<< * * cls.overridden += (overriding,) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Container_0_could_not_be_overrid_2, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Container_0_could_not_be_overrid_2, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -5843,13 +5846,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_7) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cls); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cls); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_cls}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -5857,19 +5860,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_cls}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_cls); __Pyx_GIVEREF(__pyx_v_cls); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_cls); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -5886,14 +5889,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_6) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __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, 279, __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, 283, __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; @@ -5902,20 +5905,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #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, 279, __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, 283, __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, 279, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __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, 279, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -5923,9 +5926,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __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, 279, __pyx_L1_error) + __PYX_ERR(0, 283, __pyx_L1_error) - /* "dependency_injector/containers.pyx":278 + /* "dependency_injector/containers.pyx":282 * :rtype: None * """ * if issubclass(cls, overriding): # <<<<<<<<<<<<<< @@ -5934,40 +5937,40 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai */ } - /* "dependency_injector/containers.pyx":282 + /* "dependency_injector/containers.pyx":286 * 'with itself or its subclasses'.format(cls)) * * cls.overridden += (overriding,) # <<<<<<<<<<<<<< * * for name, provider in six.iteritems(overriding.cls_providers): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_overriding); __Pyx_GIVEREF(__pyx_v_overriding); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_overriding); - __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_8) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_8) < 0) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":284 + /* "dependency_injector/containers.pyx":288 * cls.overridden += (overriding,) * * for name, provider in six.iteritems(overriding.cls_providers): # <<<<<<<<<<<<<< * try: * getattr(cls, name).override(provider) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_overriding, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_overriding, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -5980,14 +5983,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_5) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5996,20 +5999,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6019,9 +6022,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 288, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -6029,17 +6032,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 288, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 288, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -6049,7 +6052,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai 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, 284, __pyx_L1_error) + else __PYX_ERR(0, 288, __pyx_L1_error) } break; } @@ -6065,7 +6068,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 284, __pyx_L1_error) + __PYX_ERR(0, 288, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6078,15 +6081,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; @@ -6094,7 +6097,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 284, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_unpacking_done; @@ -6102,7 +6105,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 284, __pyx_L1_error) + __PYX_ERR(0, 288, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6); @@ -6110,7 +6113,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":285 + /* "dependency_injector/containers.pyx":289 * * for name, provider in six.iteritems(overriding.cls_providers): * try: # <<<<<<<<<<<<<< @@ -6126,16 +6129,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { - /* "dependency_injector/containers.pyx":286 + /* "dependency_injector/containers.pyx":290 * for name, provider in six.iteritems(overriding.cls_providers): * try: * getattr(cls, name).override(provider) # <<<<<<<<<<<<<< * except AttributeError: * pass */ - __pyx_t_4 = __Pyx_GetAttr(__pyx_v_cls, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_4 = __Pyx_GetAttr(__pyx_v_cls, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_override); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_override); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -6149,13 +6152,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_4) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_provider); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_provider); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_provider}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_8); } else @@ -6163,19 +6166,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_provider}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_provider); __Pyx_GIVEREF(__pyx_v_provider); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_provider); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L8_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -6183,7 +6186,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":285 + /* "dependency_injector/containers.pyx":289 * * for name, provider in six.iteritems(overriding.cls_providers): * try: # <<<<<<<<<<<<<< @@ -6203,7 +6206,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":287 + /* "dependency_injector/containers.pyx":291 * try: * getattr(cls, name).override(provider) * except AttributeError: # <<<<<<<<<<<<<< @@ -6218,7 +6221,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai goto __pyx_L10_except_error; __pyx_L10_except_error:; - /* "dependency_injector/containers.pyx":285 + /* "dependency_injector/containers.pyx":289 * * for name, provider in six.iteritems(overriding.cls_providers): * try: # <<<<<<<<<<<<<< @@ -6240,7 +6243,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_L15_try_end:; } - /* "dependency_injector/containers.pyx":284 + /* "dependency_injector/containers.pyx":288 * cls.overridden += (overriding,) * * for name, provider in six.iteritems(overriding.cls_providers): # <<<<<<<<<<<<<< @@ -6250,10 +6253,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":267 + /* "dependency_injector/containers.pyx":271 * * @classmethod - * def override(cls, overriding): # <<<<<<<<<<<<<< + * def override(cls, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ @@ -6278,7 +6281,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":291 +/* "dependency_injector/containers.pyx":295 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< @@ -6317,30 +6320,30 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject *(*__pyx_t_10)(PyObject *); __Pyx_RefNannySetupContext("reset_last_overriding", 0); - /* "dependency_injector/containers.pyx":296 + /* "dependency_injector/containers.pyx":300 * :rtype: None * """ * if not cls.overridden: # <<<<<<<<<<<<<< * raise Error('Container {0} is not overridden'.format(cls)) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - /* "dependency_injector/containers.pyx":297 + /* "dependency_injector/containers.pyx":301 * """ * if not cls.overridden: * raise Error('Container {0} is not overridden'.format(cls)) # <<<<<<<<<<<<<< * * cls.overridden = cls.overridden[:-1] */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Container_0_is_not_overridden, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Container_0_is_not_overridden, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6353,13 +6356,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_7) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cls); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cls); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_cls}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -6367,19 +6370,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_cls}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_cls); __Pyx_GIVEREF(__pyx_v_cls); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_cls); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -6396,14 +6399,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6412,20 +6415,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __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, 297, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __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_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -6433,9 +6436,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 297, __pyx_L1_error) + __PYX_ERR(0, 301, __pyx_L1_error) - /* "dependency_injector/containers.pyx":296 + /* "dependency_injector/containers.pyx":300 * :rtype: None * """ * if not cls.overridden: # <<<<<<<<<<<<<< @@ -6444,34 +6447,34 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai */ } - /* "dependency_injector/containers.pyx":299 + /* "dependency_injector/containers.pyx":303 * raise Error('Container {0} is not overridden'.format(cls)) * * cls.overridden = cls.overridden[:-1] # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.providers): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_4) < 0) __PYX_ERR(0, 299, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_4) < 0) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":301 + /* "dependency_injector/containers.pyx":305 * cls.overridden = cls.overridden[:-1] * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * provider.reset_last_overriding() * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -6484,14 +6487,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_5) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6500,20 +6503,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6523,9 +6526,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 305, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -6533,17 +6536,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 305, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 305, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -6553,7 +6556,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai 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, 301, __pyx_L1_error) + else __PYX_ERR(0, 305, __pyx_L1_error) } break; } @@ -6562,14 +6565,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":302 + /* "dependency_injector/containers.pyx":306 * * for provider in six.itervalues(cls.providers): * provider.reset_last_overriding() # <<<<<<<<<<<<<< * * @classmethod */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_last_overriding); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_last_overriding); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6582,16 +6585,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (__pyx_t_1) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":301 + /* "dependency_injector/containers.pyx":305 * cls.overridden = cls.overridden[:-1] * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< @@ -6601,7 +6604,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":291 + /* "dependency_injector/containers.pyx":295 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< @@ -6628,7 +6631,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":305 +/* "dependency_injector/containers.pyx":309 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< @@ -6664,31 +6667,31 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject *(*__pyx_t_7)(PyObject *); __Pyx_RefNannySetupContext("reset_override", 0); - /* "dependency_injector/containers.pyx":310 + /* "dependency_injector/containers.pyx":314 * :rtype: None * """ * cls.overridden = tuple() # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.providers): */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_1) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_1) < 0) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":312 + /* "dependency_injector/containers.pyx":316 * cls.overridden = tuple() * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * provider.reset_override() * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -6701,14 +6704,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __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, 316, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6717,20 +6720,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __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, 316, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -6740,9 +6743,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -6750,17 +6753,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 316, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 316, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -6770,7 +6773,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai 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, 312, __pyx_L1_error) + else __PYX_ERR(0, 316, __pyx_L1_error) } break; } @@ -6779,14 +6782,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":313 + /* "dependency_injector/containers.pyx":317 * * for provider in six.itervalues(cls.providers): * provider.reset_override() # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_override); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_override); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -6799,16 +6802,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } } if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":312 + /* "dependency_injector/containers.pyx":316 * cls.overridden = tuple() * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< @@ -6818,7 +6821,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":305 + /* "dependency_injector/containers.pyx":309 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< @@ -6844,7 +6847,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":316 +/* "dependency_injector/containers.pyx":320 * * * def override(object container): # <<<<<<<<<<<<<< @@ -6867,10 +6870,10 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_1override(PyObject return __pyx_r; } -/* "dependency_injector/containers.pyx":326 +/* "dependency_injector/containers.pyx":330 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ - * def _decorator(overriding_container): # <<<<<<<<<<<<<< + * def _decorator(object overriding_container): # <<<<<<<<<<<<<< * """Overriding decorator.""" * container.override(overriding_container) */ @@ -6903,15 +6906,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_override *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "dependency_injector/containers.pyx":328 - * def _decorator(overriding_container): + /* "dependency_injector/containers.pyx":332 + * def _decorator(object overriding_container): * """Overriding decorator.""" * container.override(overriding_container) # <<<<<<<<<<<<<< * return overriding_container * return _decorator */ - if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 328, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 332, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6924,13 +6927,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_overriding_container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_overriding_container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_overriding_container}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __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, 332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6938,19 +6941,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_overriding_container}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __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, 332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_overriding_container); __Pyx_GIVEREF(__pyx_v_overriding_container); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_overriding_container); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -6958,7 +6961,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":329 + /* "dependency_injector/containers.pyx":333 * """Overriding decorator.""" * container.override(overriding_container) * return overriding_container # <<<<<<<<<<<<<< @@ -6970,10 +6973,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato __pyx_r = __pyx_v_overriding_container; goto __pyx_L0; - /* "dependency_injector/containers.pyx":326 + /* "dependency_injector/containers.pyx":330 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ - * def _decorator(overriding_container): # <<<<<<<<<<<<<< + * def _decorator(object overriding_container): # <<<<<<<<<<<<<< * """Overriding decorator.""" * container.override(overriding_container) */ @@ -6992,7 +6995,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato return __pyx_r; } -/* "dependency_injector/containers.pyx":316 +/* "dependency_injector/containers.pyx":320 * * * def override(object container): # <<<<<<<<<<<<<< @@ -7011,7 +7014,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_override(CYTHON_UNU if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_override *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 316, __pyx_L1_error) + __PYX_ERR(0, 320, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -7019,19 +7022,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_override(CYTHON_UNU __Pyx_INCREF(__pyx_cur_scope->__pyx_v_container); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_container); - /* "dependency_injector/containers.pyx":326 + /* "dependency_injector/containers.pyx":330 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ - * def _decorator(overriding_container): # <<<<<<<<<<<<<< + * def _decorator(object overriding_container): # <<<<<<<<<<<<<< * """Overriding decorator.""" * container.override(overriding_container) */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_8override_1_decorator, 0, __pyx_n_s_override_locals__decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_8override_1_decorator, 0, __pyx_n_s_override_locals__decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__decorator = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":330 + /* "dependency_injector/containers.pyx":334 * container.override(overriding_container) * return overriding_container * return _decorator # <<<<<<<<<<<<<< @@ -7043,7 +7046,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_override(CYTHON_UNU __pyx_r = __pyx_v__decorator; goto __pyx_L0; - /* "dependency_injector/containers.pyx":316 + /* "dependency_injector/containers.pyx":320 * * * def override(object container): # <<<<<<<<<<<<<< @@ -7064,7 +7067,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_override(CYTHON_UNU return __pyx_r; } -/* "dependency_injector/containers.pyx":333 +/* "dependency_injector/containers.pyx":337 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -7087,11 +7090,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_3copy(PyObject *__p return __pyx_r; } -/* "dependency_injector/containers.pyx":346 +/* "dependency_injector/containers.pyx":350 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(copied_container): # <<<<<<<<<<<<<< - * memo = dict() + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): */ @@ -7112,7 +7115,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_4copy_1_decorator(P static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(PyObject *__pyx_self, PyObject *__pyx_v_copied_container) { struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_copy *__pyx_cur_scope; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_copy *__pyx_outer_scope; - PyObject *__pyx_v_memo = NULL; + PyObject *__pyx_v_memo = 0; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_provider = NULL; PyObject *__pyx_v_source_provider = NULL; @@ -7137,31 +7140,31 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_copy *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "dependency_injector/containers.pyx":347 + /* "dependency_injector/containers.pyx":351 * """ * def _decorator(copied_container): - * memo = dict() # <<<<<<<<<<<<<< + * cdef dict memo = dict() # <<<<<<<<<<<<<< * for name, provider in six.iteritems(copied_container.cls_providers): * try: */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_memo = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":348 + /* "dependency_injector/containers.pyx":352 * def _decorator(copied_container): - * memo = dict() + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): # <<<<<<<<<<<<<< * try: * source_provider = getattr(container, name) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_container, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_container, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -7174,14 +7177,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __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, 352, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7190,20 +7193,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __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, 352, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -7213,9 +7216,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7223,17 +7226,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 352, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 352, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -7243,7 +7246,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py 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, 348, __pyx_L1_error) + else __PYX_ERR(0, 352, __pyx_L1_error) } break; } @@ -7259,7 +7262,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 348, __pyx_L1_error) + __PYX_ERR(0, 352, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7272,15 +7275,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -7288,7 +7291,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 348, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 352, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_unpacking_done; @@ -7296,7 +7299,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 348, __pyx_L1_error) + __PYX_ERR(0, 352, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); @@ -7304,8 +7307,8 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":349 - * memo = dict() + /* "dependency_injector/containers.pyx":353 + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): * try: # <<<<<<<<<<<<<< * source_provider = getattr(container, name) @@ -7320,24 +7323,24 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { - /* "dependency_injector/containers.pyx":350 + /* "dependency_injector/containers.pyx":354 * for name, provider in six.iteritems(copied_container.cls_providers): * try: * source_provider = getattr(container, name) # <<<<<<<<<<<<<< * except AttributeError: * pass */ - if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 350, __pyx_L7_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 354, __pyx_L7_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_v_container; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L7_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_source_provider, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":349 - * memo = dict() + /* "dependency_injector/containers.pyx":353 + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): * try: # <<<<<<<<<<<<<< * source_provider = getattr(container, name) @@ -7345,7 +7348,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py */ } - /* "dependency_injector/containers.pyx":354 + /* "dependency_injector/containers.pyx":358 * pass * else: * memo[id(source_provider)] = provider # <<<<<<<<<<<<<< @@ -7353,15 +7356,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py * providers_copy = deepcopy(container.providers, memo) */ /*else:*/ { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L9_except_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source_provider); __Pyx_GIVEREF(__pyx_v_source_provider); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source_provider); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L9_except_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_memo, __pyx_t_1, __pyx_v_provider) < 0)) __PYX_ERR(0, 354, __pyx_L9_except_error) + if (unlikely(PyDict_SetItem(__pyx_v_memo, __pyx_t_1, __pyx_v_provider) < 0)) __PYX_ERR(0, 358, __pyx_L9_except_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -7375,7 +7378,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":351 + /* "dependency_injector/containers.pyx":355 * try: * source_provider = getattr(container, name) * except AttributeError: # <<<<<<<<<<<<<< @@ -7390,8 +7393,8 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py goto __pyx_L9_except_error; __pyx_L9_except_error:; - /* "dependency_injector/containers.pyx":349 - * memo = dict() + /* "dependency_injector/containers.pyx":353 + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): * try: # <<<<<<<<<<<<<< * source_provider = getattr(container, name) @@ -7412,9 +7415,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __pyx_L14_try_end:; } - /* "dependency_injector/containers.pyx":348 + /* "dependency_injector/containers.pyx":352 * def _decorator(copied_container): - * memo = dict() + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): # <<<<<<<<<<<<<< * try: * source_provider = getattr(container, name) @@ -7422,34 +7425,34 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":356 + /* "dependency_injector/containers.pyx":360 * memo[id(source_provider)] = provider * * providers_copy = deepcopy(container.providers, memo) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(providers_copy): * setattr(copied_container, name, provider) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 356, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 360, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13.__pyx_n = 1; __pyx_t_13.memo = __pyx_v_memo; - __pyx_t_1 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_3, 0, &__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_3, 0, &__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_providers_copy = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":357 + /* "dependency_injector/containers.pyx":361 * * providers_copy = deepcopy(container.providers, memo) * for name, provider in six.iteritems(providers_copy): # <<<<<<<<<<<<<< * setattr(copied_container, name, provider) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -7463,13 +7466,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_providers_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_providers_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_providers_copy}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __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, 361, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -7477,19 +7480,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_providers_copy}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __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, 361, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __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_INCREF(__pyx_v_providers_copy); __Pyx_GIVEREF(__pyx_v_providers_copy); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_providers_copy); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -7499,9 +7502,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7509,17 +7512,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= 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_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= 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_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -7529,7 +7532,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py 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, 357, __pyx_L1_error) + else __PYX_ERR(0, 361, __pyx_L1_error) } break; } @@ -7545,7 +7548,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 357, __pyx_L1_error) + __PYX_ERR(0, 361, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7558,15 +7561,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -7574,7 +7577,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 357, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L18_unpacking_done; @@ -7582,7 +7585,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 357, __pyx_L1_error) + __PYX_ERR(0, 361, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); @@ -7590,16 +7593,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":358 + /* "dependency_injector/containers.pyx":362 * providers_copy = deepcopy(container.providers, memo) * for name, provider in six.iteritems(providers_copy): * setattr(copied_container, name, provider) # <<<<<<<<<<<<<< * * return copied_container */ - __pyx_t_14 = PyObject_SetAttr(__pyx_v_copied_container, __pyx_v_name, __pyx_v_provider); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_14 = PyObject_SetAttr(__pyx_v_copied_container, __pyx_v_name, __pyx_v_provider); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 362, __pyx_L1_error) - /* "dependency_injector/containers.pyx":357 + /* "dependency_injector/containers.pyx":361 * * providers_copy = deepcopy(container.providers, memo) * for name, provider in six.iteritems(providers_copy): # <<<<<<<<<<<<<< @@ -7609,7 +7612,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":360 + /* "dependency_injector/containers.pyx":364 * setattr(copied_container, name, provider) * * return copied_container # <<<<<<<<<<<<<< @@ -7621,11 +7624,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py __pyx_r = __pyx_v_copied_container; goto __pyx_L0; - /* "dependency_injector/containers.pyx":346 + /* "dependency_injector/containers.pyx":350 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(copied_container): # <<<<<<<<<<<<<< - * memo = dict() + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): */ @@ -7649,7 +7652,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__decorator(Py return __pyx_r; } -/* "dependency_injector/containers.pyx":333 +/* "dependency_injector/containers.pyx":337 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -7668,7 +7671,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_2copy(CYTHON_UNUSED if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_copy *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 333, __pyx_L1_error) + __PYX_ERR(0, 337, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -7676,19 +7679,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_2copy(CYTHON_UNUSED __Pyx_INCREF(__pyx_cur_scope->__pyx_v_container); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_container); - /* "dependency_injector/containers.pyx":346 + /* "dependency_injector/containers.pyx":350 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(copied_container): # <<<<<<<<<<<<<< - * memo = dict() + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_4copy_1_decorator, 0, __pyx_n_s_copy_locals__decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_4copy_1_decorator, 0, __pyx_n_s_copy_locals__decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__decorator = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":361 + /* "dependency_injector/containers.pyx":365 * * return copied_container * return _decorator # <<<<<<<<<<<<<< @@ -7700,7 +7703,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_2copy(CYTHON_UNUSED __pyx_r = __pyx_v__decorator; goto __pyx_L0; - /* "dependency_injector/containers.pyx":333 + /* "dependency_injector/containers.pyx":337 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -7721,7 +7724,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_2copy(CYTHON_UNUSED return __pyx_r; } -/* "dependency_injector/containers.pyx":364 +/* "dependency_injector/containers.pyx":368 * * * cpdef bint is_container(object instance): # <<<<<<<<<<<<<< @@ -7737,21 +7740,21 @@ static int __pyx_f_19dependency_injector_10containers_is_container(PyObject *__p int __pyx_t_2; __Pyx_RefNannySetupContext("is_container", 0); - /* "dependency_injector/containers.pyx":372 + /* "dependency_injector/containers.pyx":376 * :rtype: bool * """ * return getattr(instance, '__IS_CONTAINER__', False) is True # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_instance, __pyx_n_s_IS_CONTAINER, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_instance, __pyx_n_s_IS_CONTAINER, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_True); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; goto __pyx_L0; - /* "dependency_injector/containers.pyx":364 + /* "dependency_injector/containers.pyx":368 * * * cpdef bint is_container(object instance): # <<<<<<<<<<<<<< @@ -7789,7 +7792,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4is_container(CYTHO PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("is_container", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_19dependency_injector_10containers_is_container(__pyx_v_instance, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_19dependency_injector_10containers_is_container(__pyx_v_instance, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7806,7 +7809,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4is_container(CYTHO return __pyx_r; } -/* "dependency_injector/containers.pyx":375 +/* "dependency_injector/containers.pyx":379 * * * cpdef object _check_provider_type(object container, object provider): # <<<<<<<<<<<<<< @@ -7830,37 +7833,37 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("_check_provider_type", 0); - /* "dependency_injector/containers.pyx":376 + /* "dependency_injector/containers.pyx":380 * * cpdef object _check_provider_type(object container, object provider): * if not isinstance(provider, container.provider_type): # <<<<<<<<<<<<<< * raise Error('{0} can contain only {1} ' * 'instances'.format(container, container.provider_type)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_provider, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_provider, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { - /* "dependency_injector/containers.pyx":377 + /* "dependency_injector/containers.pyx":381 * cpdef object _check_provider_type(object container, object provider): * if not isinstance(provider, container.provider_type): * raise Error('{0} can contain only {1} ' # <<<<<<<<<<<<<< * 'instances'.format(container, container.provider_type)) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "dependency_injector/containers.pyx":378 + /* "dependency_injector/containers.pyx":382 * if not isinstance(provider, container.provider_type): * raise Error('{0} can contain only {1} ' * 'instances'.format(container, container.provider_type)) # <<<<<<<<<<<<<< */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_contain_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_contain_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -7877,7 +7880,7 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_container, __pyx_t_7}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7886,14 +7889,14 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_container, __pyx_t_7}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -7904,7 +7907,7 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -7920,14 +7923,14 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type } } if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -7936,20 +7939,20 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -7957,9 +7960,9 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 377, __pyx_L1_error) + __PYX_ERR(0, 381, __pyx_L1_error) - /* "dependency_injector/containers.pyx":376 + /* "dependency_injector/containers.pyx":380 * * cpdef object _check_provider_type(object container, object provider): * if not isinstance(provider, container.provider_type): # <<<<<<<<<<<<<< @@ -7968,7 +7971,7 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type */ } - /* "dependency_injector/containers.pyx":375 + /* "dependency_injector/containers.pyx":379 * * * cpdef object _check_provider_type(object container, object provider): # <<<<<<<<<<<<<< @@ -8023,11 +8026,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_7_check_provider_ty case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provider)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, 1); __PYX_ERR(0, 375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, 1); __PYX_ERR(0, 379, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_provider_type") < 0)) __PYX_ERR(0, 375, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_provider_type") < 0)) __PYX_ERR(0, 379, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -8040,7 +8043,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_7_check_provider_ty } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 379, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers._check_provider_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8059,7 +8062,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_6_check_provider_ty PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_check_provider_type", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_19dependency_injector_10containers__check_provider_type(__pyx_v_container, __pyx_v_provider, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __pyx_f_19dependency_injector_10containers__check_provider_type(__pyx_v_container, __pyx_v_provider, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8941,10 +8944,10 @@ static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_ PyObject* tmp; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct____new__ *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct____new__ *)o; tmp = ((PyObject*)p->__pyx_v_attributes); - p->__pyx_v_attributes = Py_None; Py_INCREF(Py_None); + p->__pyx_v_attributes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_bases); - p->__pyx_v_bases = Py_None; Py_INCREF(Py_None); + p->__pyx_v_bases = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } @@ -9157,7 +9160,7 @@ static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_stru Py_CLEAR(p->__pyx_v_name); Py_CLEAR(p->__pyx_v_provider); Py_CLEAR(p->__pyx_t_0); - Py_CLEAR(p->__pyx_t_3); + Py_CLEAR(p->__pyx_t_2); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2_genexpr)))) { __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2_genexpr[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2_genexpr *)o); } else { @@ -9183,8 +9186,8 @@ static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_stru if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } - if (p->__pyx_t_3) { - e = (*v)(p->__pyx_t_3, a); if (e) return e; + if (p->__pyx_t_2) { + e = (*v)(p->__pyx_t_2, a); if (e) return e; } return 0; } @@ -9207,8 +9210,8 @@ static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_ tmp = ((PyObject*)p->__pyx_t_0); p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_3); - p->__pyx_t_3 = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_t_2); + p->__pyx_t_2 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } @@ -9597,7 +9600,7 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 16, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 111, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 358, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -9619,40 +9622,40 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); - /* "dependency_injector/containers.pyx":299 + /* "dependency_injector/containers.pyx":303 * raise Error('Container {0} is not overridden'.format(cls)) * * cls.overridden = cls.overridden[:-1] # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.providers): */ - __pyx_slice__2 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_slice__2 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__2); __Pyx_GIVEREF(__pyx_slice__2); - /* "dependency_injector/containers.pyx":326 + /* "dependency_injector/containers.pyx":330 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ - * def _decorator(overriding_container): # <<<<<<<<<<<<<< + * def _decorator(object overriding_container): # <<<<<<<<<<<<<< * """Overriding decorator.""" * container.override(overriding_container) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_overriding_container); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_overriding_container); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_decorator, 326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_decorator, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 330, __pyx_L1_error) - /* "dependency_injector/containers.pyx":346 + /* "dependency_injector/containers.pyx":350 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(copied_container): # <<<<<<<<<<<<<< - * memo = dict() + * cdef dict memo = dict() * for name, provider in six.iteritems(copied_container.cls_providers): */ - __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_copied_container, __pyx_n_s_memo, __pyx_n_s_name, __pyx_n_s_provider, __pyx_n_s_source_provider, __pyx_n_s_providers_copy); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_copied_container, __pyx_n_s_memo, __pyx_n_s_name, __pyx_n_s_provider, __pyx_n_s_source_provider, __pyx_n_s_providers_copy); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_decorator, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_decorator, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 350, __pyx_L1_error) /* "dependency_injector/containers.pyx":47 * __IS_CONTAINER__ = True @@ -9693,7 +9696,7 @@ static int __Pyx_InitCachedConstants(void) { /* "dependency_injector/containers.pyx":91 * super(DynamicContainer, self).__delattr__(name) * - * def override(self, overriding): # <<<<<<<<<<<<<< + * def override(self, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ @@ -9729,110 +9732,110 @@ static int __Pyx_InitCachedConstants(void) { /* "dependency_injector/containers.pyx":141 * """Declarative inversion of control container meta class.""" * - * def __new__(mcs, class_name, bases, attributes): # <<<<<<<<<<<<<< + * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" - * cls_providers = tuple((name, provider) + * cdef tuple cls_providers */ __pyx_tuple__19 = PyTuple_Pack(11, __pyx_n_s_mcs, __pyx_n_s_class_name, __pyx_n_s_bases, __pyx_n_s_attributes, __pyx_n_s_cls_providers, __pyx_n_s_inherited_providers, __pyx_n_s_cls, __pyx_n_s_provider, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_new, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 141, __pyx_L1_error) - /* "dependency_injector/containers.pyx":164 + /* "dependency_injector/containers.pyx":168 * return cls * - * def __setattr__(cls, name, value): # <<<<<<<<<<<<<< + * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< * """Set class attribute. * */ - __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_setattr, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_setattr, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 168, __pyx_L1_error) - /* "dependency_injector/containers.pyx":184 + /* "dependency_injector/containers.pyx":188 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * - * def __delattr__(cls, name): # <<<<<<<<<<<<<< + * def __delattr__(cls, str name): # <<<<<<<<<<<<<< * """Delete class attribute. * */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_name); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_name); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_delattr, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_delattr, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 188, __pyx_L1_error) - /* "dependency_injector/containers.pyx":252 + /* "dependency_injector/containers.pyx":256 * """ * * def __new__(cls, *args, **kwargs): # <<<<<<<<<<<<<< * """Constructor. * */ - __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_container, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_container, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_new, 252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_new, 256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 256, __pyx_L1_error) - /* "dependency_injector/containers.pyx":267 + /* "dependency_injector/containers.pyx":271 * * @classmethod - * def override(cls, overriding): # <<<<<<<<<<<<<< + * def override(cls, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ - __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_overriding, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_overriding, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_override, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_override, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 271, __pyx_L1_error) - /* "dependency_injector/containers.pyx":291 + /* "dependency_injector/containers.pyx":295 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< * """Reset last overriding provider for each container providers. * */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_reset_last_overriding, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_reset_last_overriding, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 295, __pyx_L1_error) - /* "dependency_injector/containers.pyx":305 + /* "dependency_injector/containers.pyx":309 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< * """Reset all overridings for each container providers. * */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_reset_override, 305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_reset_override, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 309, __pyx_L1_error) - /* "dependency_injector/containers.pyx":316 + /* "dependency_injector/containers.pyx":320 * * * def override(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` overriding decorator. * */ - __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_container, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_container, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_override, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_override, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 320, __pyx_L1_error) - /* "dependency_injector/containers.pyx":333 + /* "dependency_injector/containers.pyx":337 * * * def copy(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` copying decorator. * */ - __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_container, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_container, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_copy, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_romanmogilatov_ets_labs_p, __pyx_n_s_copy, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -9947,16 +9950,16 @@ PyMODINIT_FUNC PyInit_containers(void) if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct____new__) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_type_19dependency_injector_10containers___pyx_scope_struct____new__.tp_print = 0; __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct____new__ = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct____new__; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_type_19dependency_injector_10containers___pyx_scope_struct_1_genexpr.tp_print = 0; __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_1_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_1_genexpr; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2_genexpr.tp_print = 0; __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2_genexpr; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_override) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_override) < 0) __PYX_ERR(0, 320, __pyx_L1_error) __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_override.tp_print = 0; __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3_override = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_override; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_copy) < 0) __PYX_ERR(0, 333, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_copy) < 0) __PYX_ERR(0, 337, __pyx_L1_error) __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_copy.tp_print = 0; __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4_copy = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_copy; /*--- Type import code ---*/ @@ -10107,7 +10110,7 @@ PyMODINIT_FUNC PyInit_containers(void) /* "dependency_injector/containers.pyx":91 * super(DynamicContainer, self).__delattr__(name) * - * def override(self, overriding): # <<<<<<<<<<<<<< + * def override(self, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ @@ -10175,37 +10178,37 @@ PyMODINIT_FUNC PyInit_containers(void) /* "dependency_injector/containers.pyx":141 * """Declarative inversion of control container meta class.""" * - * def __new__(mcs, class_name, bases, attributes): # <<<<<<<<<<<<<< + * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" - * cls_providers = tuple((name, provider) + * cdef tuple cls_providers */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_DeclarativeContainerMetaClass_3, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_new, __pyx_t_6) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":164 + /* "dependency_injector/containers.pyx":168 * return cls * - * def __setattr__(cls, name, value): # <<<<<<<<<<<<<< + * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< * """Set class attribute. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_3__setattr__, 0, __pyx_n_s_DeclarativeContainerMetaClass_4, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_3__setattr__, 0, __pyx_n_s_DeclarativeContainerMetaClass_4, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_setattr, __pyx_t_6) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_setattr, __pyx_t_6) < 0) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":184 + /* "dependency_injector/containers.pyx":188 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * - * def __delattr__(cls, name): # <<<<<<<<<<<<<< + * def __delattr__(cls, str name): # <<<<<<<<<<<<<< * """Delete class attribute. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_5__delattr__, 0, __pyx_n_s_DeclarativeContainerMetaClass_5, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_5__delattr__, 0, __pyx_n_s_DeclarativeContainerMetaClass_5, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_delattr, __pyx_t_6) < 0) __PYX_ERR(0, 184, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_delattr, __pyx_t_6) < 0) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "dependency_injector/containers.pyx":138 @@ -10223,195 +10226,195 @@ PyMODINIT_FUNC PyInit_containers(void) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":202 + /* "dependency_injector/containers.pyx":206 * * @six.add_metaclass(DeclarativeContainerMetaClass) * class DeclarativeContainer(object): # <<<<<<<<<<<<<< * """Declarative inversion of control container. * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_object); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_4, __pyx_n_s_DeclarativeContainer, __pyx_n_s_DeclarativeContainer, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, __pyx_kp_s_Declarative_inversion_of_control_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_4, __pyx_n_s_DeclarativeContainer, __pyx_n_s_DeclarativeContainer, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, __pyx_kp_s_Declarative_inversion_of_control_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "dependency_injector/containers.pyx":213 + /* "dependency_injector/containers.pyx":217 * """ * * __IS_CONTAINER__ = True # <<<<<<<<<<<<<< * * provider_type = Provider */ - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_IS_CONTAINER, Py_True) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_IS_CONTAINER, Py_True) < 0) __PYX_ERR(0, 217, __pyx_L1_error) - /* "dependency_injector/containers.pyx":215 + /* "dependency_injector/containers.pyx":219 * __IS_CONTAINER__ = True * * provider_type = Provider # <<<<<<<<<<<<<< * """Type of providers that could be placed in container. * */ - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_provider_type, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider)) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_provider_type, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider)) < 0) __PYX_ERR(0, 219, __pyx_L1_error) - /* "dependency_injector/containers.pyx":221 + /* "dependency_injector/containers.pyx":225 * """ * * instance_type = DynamicContainer # <<<<<<<<<<<<<< * """Type of container that is returned on instantiating declarative * container. */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_instance_type, __pyx_t_6) < 0) __PYX_ERR(0, 221, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_instance_type, __pyx_t_6) < 0) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":228 + /* "dependency_injector/containers.pyx":232 * """ * * providers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of all providers. * */ - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_providers, __pyx_t_6) < 0) __PYX_ERR(0, 228, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_providers, __pyx_t_6) < 0) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":234 + /* "dependency_injector/containers.pyx":238 * """ * * cls_providers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of current container providers. * */ - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_cls_providers, __pyx_t_6) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_cls_providers, __pyx_t_6) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":240 + /* "dependency_injector/containers.pyx":244 * """ * * inherited_providers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of inherited providers. * */ - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_inherited_providers, __pyx_t_6) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_inherited_providers, __pyx_t_6) < 0) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":246 + /* "dependency_injector/containers.pyx":250 * """ * * overridden = tuple() # <<<<<<<<<<<<<< * """Tuple of overriding containers. * */ - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_overridden, __pyx_t_6) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_overridden, __pyx_t_6) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":252 + /* "dependency_injector/containers.pyx":256 * """ * * def __new__(cls, *args, **kwargs): # <<<<<<<<<<<<<< * """Constructor. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_DeclarativeContainer___new, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_DeclarativeContainer___new, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_new, __pyx_t_6) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_new, __pyx_t_6) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":267 + /* "dependency_injector/containers.pyx":271 * * @classmethod - * def override(cls, overriding): # <<<<<<<<<<<<<< + * def override(cls, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_3override, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_DeclarativeContainer_override, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_3override, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_DeclarativeContainer_override, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "dependency_injector/containers.pyx":266 + /* "dependency_injector/containers.pyx":270 * return container * * @classmethod # <<<<<<<<<<<<<< - * def override(cls, overriding): + * def override(cls, object overriding): * """Override current container by overriding container. */ - __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_override, __pyx_t_7) < 0) __PYX_ERR(0, 267, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_override, __pyx_t_7) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":291 + /* "dependency_injector/containers.pyx":295 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< * """Reset last overriding provider for each container providers. * */ - __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_5reset_last_overriding, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_DeclarativeContainer_reset_last, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_5reset_last_overriding, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_DeclarativeContainer_reset_last, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "dependency_injector/containers.pyx":290 + /* "dependency_injector/containers.pyx":294 * pass * * @classmethod # <<<<<<<<<<<<<< * def reset_last_overriding(cls): * """Reset last overriding provider for each container providers. */ - __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_reset_last_overriding, __pyx_t_6) < 0) __PYX_ERR(0, 291, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_reset_last_overriding, __pyx_t_6) < 0) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":305 + /* "dependency_injector/containers.pyx":309 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< * """Reset all overridings for each container providers. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_7reset_override, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_DeclarativeContainer_reset_overr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_20DeclarativeContainer_7reset_override, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_DeclarativeContainer_reset_overr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "dependency_injector/containers.pyx":304 + /* "dependency_injector/containers.pyx":308 * provider.reset_last_overriding() * * @classmethod # <<<<<<<<<<<<<< * def reset_override(cls): * """Reset all overridings for each container providers. */ - __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_reset_override, __pyx_t_7) < 0) __PYX_ERR(0, 305, __pyx_L1_error) + if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_reset_override, __pyx_t_7) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":201 + /* "dependency_injector/containers.pyx":205 * * * @six.add_metaclass(DeclarativeContainerMetaClass) # <<<<<<<<<<<<<< * class DeclarativeContainer(object): * """Declarative inversion of control container. */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_add_metaclass); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_add_metaclass); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { @@ -10424,14 +10427,14 @@ PyMODINIT_FUNC PyInit_containers(void) } } if (!__pyx_t_10) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -10440,34 +10443,34 @@ PyMODINIT_FUNC PyInit_containers(void) #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":202 + /* "dependency_injector/containers.pyx":206 * * @six.add_metaclass(DeclarativeContainerMetaClass) * class DeclarativeContainer(object): # <<<<<<<<<<<<<< * """Declarative inversion of control container. * */ - __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DeclarativeContainer, __pyx_t_4, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DeclarativeContainer, __pyx_t_4, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -10480,14 +10483,14 @@ PyMODINIT_FUNC PyInit_containers(void) } } if (!__pyx_t_11) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_7); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_9}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -10496,53 +10499,53 @@ PyMODINIT_FUNC PyInit_containers(void) #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_9}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeclarativeContainer, __pyx_t_7) < 0) __PYX_ERR(0, 202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeclarativeContainer, __pyx_t_7) < 0) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":316 + /* "dependency_injector/containers.pyx":320 * * * def override(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` overriding decorator. * */ - __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_1override, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_1override, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_override, __pyx_t_4) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_override, __pyx_t_4) < 0) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":333 + /* "dependency_injector/containers.pyx":337 * * * def copy(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` copying decorator. * */ - __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_3copy, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_3copy, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_4) < 0) __PYX_ERR(0, 333, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "dependency_injector/containers.pyx":1 diff --git a/src/dependency_injector/containers.pyx b/src/dependency_injector/containers.pyx index 55f9f10d..857f3baf 100644 --- a/src/dependency_injector/containers.pyx +++ b/src/dependency_injector/containers.pyx @@ -88,7 +88,7 @@ class DynamicContainer(object): del self.providers[name] super(DynamicContainer, self).__delattr__(name) - def override(self, overriding): + def override(self, object overriding): """Override current container by overriding container. :param overriding: Overriding container. @@ -138,8 +138,12 @@ class DynamicContainer(object): class DeclarativeContainerMetaClass(type): """Declarative inversion of control container meta class.""" - def __new__(mcs, class_name, bases, attributes): + def __new__(type mcs, str class_name, tuple bases, dict attributes): """Declarative container class factory.""" + cdef tuple cls_providers + cdef tuple inherited_providers + cdef type cls + cls_providers = tuple((name, provider) for name, provider in six.iteritems(attributes) if isinstance(provider, Provider)) @@ -154,14 +158,14 @@ class DeclarativeContainerMetaClass(type): attributes['inherited_providers'] = dict(inherited_providers) attributes['providers'] = dict(cls_providers + inherited_providers) - cls = type.__new__(mcs, class_name, bases, attributes) + cls = type.__new__(mcs, class_name, bases, attributes) for provider in six.itervalues(cls.providers): _check_provider_type(cls, provider) return cls - def __setattr__(cls, name, value): + def __setattr__(cls, str name, object value): """Set class attribute. If value of attribute is provider, it will be added into providers @@ -181,7 +185,7 @@ class DeclarativeContainerMetaClass(type): cls.cls_providers[name] = value super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) - def __delattr__(cls, name): + def __delattr__(cls, str name): """Delete class attribute. If value of attribute is provider, it will be deleted from providers @@ -264,7 +268,7 @@ class DeclarativeContainer(object): return container @classmethod - def override(cls, overriding): + def override(cls, object overriding): """Override current container by overriding container. :param overriding: Overriding container. @@ -323,7 +327,7 @@ def override(object container): :return: Declarative container's overriding decorator. :rtype: callable(:py:class:`DeclarativeContainer`) """ - def _decorator(overriding_container): + def _decorator(object overriding_container): """Overriding decorator.""" container.override(overriding_container) return overriding_container @@ -344,7 +348,7 @@ def copy(object container): :rtype: callable(:py:class:`DeclarativeContainer`) """ def _decorator(copied_container): - memo = dict() + cdef dict memo = dict() for name, provider in six.iteritems(copied_container.cls_providers): try: source_provider = getattr(container, name)