Merge branch 'feature/callable-delegate' into develop

This commit is contained in:
Roman Mogilatov 2017-07-09 23:29:59 +03:00
commit db30417e2e
6 changed files with 2001 additions and 1488 deletions

View File

@ -9,6 +9,7 @@ follows `Semantic versioning`_
Development Development
----------- -----------
- Add ``CallableDelegate`` provider.
- Add ``FactoryDelegate`` provider. - Add ``FactoryDelegate`` provider.
3.5.0 3.5.0

View File

@ -637,6 +637,7 @@ struct __pyx_obj_19dependency_injector_9providers_OverridingContext;
struct __pyx_obj_19dependency_injector_9providers_Callable; struct __pyx_obj_19dependency_injector_9providers_Callable;
struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable; struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable;
struct __pyx_obj_19dependency_injector_9providers_AbstractCallable; struct __pyx_obj_19dependency_injector_9providers_AbstractCallable;
struct __pyx_obj_19dependency_injector_9providers_CallableDelegate;
struct __pyx_obj_19dependency_injector_9providers_Configuration; struct __pyx_obj_19dependency_injector_9providers_Configuration;
struct __pyx_obj_19dependency_injector_9providers_Factory; struct __pyx_obj_19dependency_injector_9providers_Factory;
struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory; struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory;
@ -660,7 +661,7 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_overrid
struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_copy; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_copy;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy; struct __pyx_opt_args_19dependency_injector_9providers_deepcopy;
/* "providers.pxd":170 /* "providers.pxd":174
* *
* *
* cpdef object deepcopy(object instance, dict memo=*) # <<<<<<<<<<<<<< * cpdef object deepcopy(object instance, dict memo=*) # <<<<<<<<<<<<<<
@ -781,7 +782,19 @@ struct __pyx_obj_19dependency_injector_9providers_AbstractCallable {
}; };
/* "providers.pxd":59 /* "providers.pxd":58
*
*
* cdef class CallableDelegate(Delegate): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_CallableDelegate {
struct __pyx_obj_19dependency_injector_9providers_Delegate __pyx_base;
};
/* "providers.pxd":63
* *
* # Configuration providers * # Configuration providers
* cdef class Configuration(Provider): # <<<<<<<<<<<<<< * cdef class Configuration(Provider): # <<<<<<<<<<<<<<
@ -796,7 +809,7 @@ struct __pyx_obj_19dependency_injector_9providers_Configuration {
}; };
/* "providers.pxd":71 /* "providers.pxd":75
* *
* # Factory providers * # Factory providers
* cdef class Factory(Provider): # <<<<<<<<<<<<<< * cdef class Factory(Provider): # <<<<<<<<<<<<<<
@ -811,7 +824,7 @@ struct __pyx_obj_19dependency_injector_9providers_Factory {
}; };
/* "providers.pxd":80 /* "providers.pxd":84
* *
* *
* cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<< * cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<<
@ -823,7 +836,7 @@ struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory {
}; };
/* "providers.pxd":84 /* "providers.pxd":88
* *
* *
* cdef class AbstractFactory(Factory): # <<<<<<<<<<<<<< * cdef class AbstractFactory(Factory): # <<<<<<<<<<<<<<
@ -835,7 +848,7 @@ struct __pyx_obj_19dependency_injector_9providers_AbstractFactory {
}; };
/* "providers.pxd":88 /* "providers.pxd":92
* *
* *
* cdef class FactoryDelegate(Delegate): # <<<<<<<<<<<<<< * cdef class FactoryDelegate(Delegate): # <<<<<<<<<<<<<<
@ -847,7 +860,7 @@ struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate {
}; };
/* "providers.pxd":93 /* "providers.pxd":97
* *
* # Singleton providers * # Singleton providers
* cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<< * cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<<
@ -860,7 +873,7 @@ struct __pyx_obj_19dependency_injector_9providers_BaseSingleton {
}; };
/* "providers.pxd":97 /* "providers.pxd":101
* *
* *
* cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -873,7 +886,7 @@ struct __pyx_obj_19dependency_injector_9providers_Singleton {
}; };
/* "providers.pxd":103 /* "providers.pxd":107
* *
* *
* cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<< * cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<<
@ -885,7 +898,7 @@ struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton {
}; };
/* "providers.pxd":107 /* "providers.pxd":111
* *
* *
* cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -899,7 +912,7 @@ struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton {
}; };
/* "providers.pxd":114 /* "providers.pxd":118
* *
* *
* cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<< * cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<<
@ -911,7 +924,7 @@ struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton {
}; };
/* "providers.pxd":118 /* "providers.pxd":122
* *
* *
* cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -924,7 +937,7 @@ struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton {
}; };
/* "providers.pxd":124 /* "providers.pxd":128
* *
* *
* cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<< * cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<<
@ -936,7 +949,7 @@ struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton
}; };
/* "providers.pxd":128 /* "providers.pxd":132
* *
* *
* cdef class AbstractSingleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class AbstractSingleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -948,7 +961,7 @@ struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton {
}; };
/* "providers.pxd":133 /* "providers.pxd":137
* *
* # Injections * # Injections
* cdef class Injection(object): # <<<<<<<<<<<<<< * cdef class Injection(object): # <<<<<<<<<<<<<<
@ -964,7 +977,7 @@ struct __pyx_obj_19dependency_injector_9providers_Injection {
}; };
/* "providers.pxd":140 /* "providers.pxd":144
* *
* *
* cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<< * cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<<
@ -976,7 +989,7 @@ struct __pyx_obj_19dependency_injector_9providers_PositionalInjection {
}; };
/* "providers.pxd":144 /* "providers.pxd":148
* *
* *
* cdef class NamedInjection(Injection): # <<<<<<<<<<<<<< * cdef class NamedInjection(Injection): # <<<<<<<<<<<<<<
@ -1167,7 +1180,21 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable {
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable *__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable; static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable *__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable;
/* "providers.pxd":59 /* "providers.pxd":58
*
*
* cdef class CallableDelegate(Delegate): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_CallableDelegate {
struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_CallableDelegate *__pyx_vtabptr_19dependency_injector_9providers_CallableDelegate;
/* "providers.pxd":63
* *
* # Configuration providers * # Configuration providers
* cdef class Configuration(Provider): # <<<<<<<<<<<<<< * cdef class Configuration(Provider): # <<<<<<<<<<<<<<
@ -1184,7 +1211,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration {
static struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *__pyx_vtabptr_19dependency_injector_9providers_Configuration; static struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *__pyx_vtabptr_19dependency_injector_9providers_Configuration;
/* "providers.pxd":71 /* "providers.pxd":75
* *
* # Factory providers * # Factory providers
* cdef class Factory(Provider): # <<<<<<<<<<<<<< * cdef class Factory(Provider): # <<<<<<<<<<<<<<
@ -1198,7 +1225,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_Factory {
static struct __pyx_vtabstruct_19dependency_injector_9providers_Factory *__pyx_vtabptr_19dependency_injector_9providers_Factory; static struct __pyx_vtabstruct_19dependency_injector_9providers_Factory *__pyx_vtabptr_19dependency_injector_9providers_Factory;
/* "providers.pxd":80 /* "providers.pxd":84
* *
* *
* cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<< * cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<<
@ -1212,7 +1239,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory {
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory *__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory; static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory *__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory;
/* "providers.pxd":84 /* "providers.pxd":88
* *
* *
* cdef class AbstractFactory(Factory): # <<<<<<<<<<<<<< * cdef class AbstractFactory(Factory): # <<<<<<<<<<<<<<
@ -1226,7 +1253,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory {
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory *__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory; static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory *__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory;
/* "providers.pxd":88 /* "providers.pxd":92
* *
* *
* cdef class FactoryDelegate(Delegate): # <<<<<<<<<<<<<< * cdef class FactoryDelegate(Delegate): # <<<<<<<<<<<<<<
@ -1240,7 +1267,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate {
static struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate *__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate; static struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate *__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate;
/* "providers.pxd":93 /* "providers.pxd":97
* *
* # Singleton providers * # Singleton providers
* cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<< * cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<<
@ -1254,7 +1281,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton {
static struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
/* "providers.pxd":97 /* "providers.pxd":101
* *
* *
* cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -1268,7 +1295,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton {
static struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton *__pyx_vtabptr_19dependency_injector_9providers_Singleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton *__pyx_vtabptr_19dependency_injector_9providers_Singleton;
/* "providers.pxd":103 /* "providers.pxd":107
* *
* *
* cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<< * cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<<
@ -1282,7 +1309,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton {
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton;
/* "providers.pxd":107 /* "providers.pxd":111
* *
* *
* cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -1296,7 +1323,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton {
static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton;
/* "providers.pxd":114 /* "providers.pxd":118
* *
* *
* cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<< * cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<<
@ -1310,7 +1337,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSing
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
/* "providers.pxd":118 /* "providers.pxd":122
* *
* *
* cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -1324,7 +1351,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton {
static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton;
/* "providers.pxd":124 /* "providers.pxd":128
* *
* *
* cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<< * cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<<
@ -1338,7 +1365,7 @@ struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSin
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton; static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
/* "providers.pxd":128 /* "providers.pxd":132
* *
* *
* cdef class AbstractSingleton(BaseSingleton): # <<<<<<<<<<<<<< * cdef class AbstractSingleton(BaseSingleton): # <<<<<<<<<<<<<<
@ -1840,6 +1867,7 @@ static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_OverridingCont
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Callable = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Callable = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedCallable = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedCallable = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_AbstractCallable = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_AbstractCallable = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_CallableDelegate = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Configuration = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Configuration = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Factory = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Factory = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedFactory = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedFactory = 0;
@ -8191,7 +8219,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_6_check_provider_ty
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":174 /* "providers.pxd":178
* *
* # Inline helper functions * # Inline helper functions
* cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<<
@ -8204,7 +8232,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_na
__Pyx_RefNannyDeclarations __Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get_name", 0); __Pyx_RefNannySetupContext("__get_name", 0);
/* "providers.pxd":175 /* "providers.pxd":179
* # Inline helper functions * # Inline helper functions
* cdef inline object __get_name(NamedInjection self): * cdef inline object __get_name(NamedInjection self):
* return self.__name # <<<<<<<<<<<<<< * return self.__name # <<<<<<<<<<<<<<
@ -8216,7 +8244,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_na
__pyx_r = __pyx_v_self->__pyx___name; __pyx_r = __pyx_v_self->__pyx___name;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":174 /* "providers.pxd":178
* *
* # Inline helper functions * # Inline helper functions
* cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<< * cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<<
@ -8231,7 +8259,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_na
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":178 /* "providers.pxd":182
* *
* *
* cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<<
@ -8248,7 +8276,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__get_value", 0); __Pyx_RefNannySetupContext("__get_value", 0);
/* "providers.pxd":179 /* "providers.pxd":183
* *
* cdef inline object __get_value(Injection self): * cdef inline object __get_value(Injection self):
* if self.__call == 0: # <<<<<<<<<<<<<< * if self.__call == 0: # <<<<<<<<<<<<<<
@ -8258,7 +8286,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
__pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0); __pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0);
if (__pyx_t_1) { if (__pyx_t_1) {
/* "providers.pxd":180 /* "providers.pxd":184
* cdef inline object __get_value(Injection self): * cdef inline object __get_value(Injection self):
* if self.__call == 0: * if self.__call == 0:
* return self.__value # <<<<<<<<<<<<<< * return self.__value # <<<<<<<<<<<<<<
@ -8270,7 +8298,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
__pyx_r = __pyx_v_self->__pyx___value; __pyx_r = __pyx_v_self->__pyx___value;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":179 /* "providers.pxd":183
* *
* cdef inline object __get_value(Injection self): * cdef inline object __get_value(Injection self):
* if self.__call == 0: # <<<<<<<<<<<<<< * if self.__call == 0: # <<<<<<<<<<<<<<
@ -8279,7 +8307,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
*/ */
} }
/* "providers.pxd":181 /* "providers.pxd":185
* if self.__call == 0: * if self.__call == 0:
* return self.__value * return self.__value
* return self.__value() # <<<<<<<<<<<<<< * return self.__value() # <<<<<<<<<<<<<<
@ -8299,10 +8327,10 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
} }
} }
if (__pyx_t_4) { if (__pyx_t_4) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 181, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 185, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else { } else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 181, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 185, __pyx_L1_error)
} }
__Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@ -8310,7 +8338,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
__pyx_t_2 = 0; __pyx_t_2 = 0;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":178 /* "providers.pxd":182
* *
* *
* cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<< * cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<<
@ -8331,7 +8359,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_va
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":186 /* "providers.pxd":190
* @cython.boundscheck(False) * @cython.boundscheck(False)
* @cython.wraparound(False) * @cython.wraparound(False)
* cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<<
@ -8352,7 +8380,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
int __pyx_t_5; int __pyx_t_5;
__Pyx_RefNannySetupContext("__provide_positional_args", 0); __Pyx_RefNannySetupContext("__provide_positional_args", 0);
/* "providers.pxd":193 /* "providers.pxd":197
* cdef PositionalInjection injection * cdef PositionalInjection injection
* *
* if inj_args_len == 0: # <<<<<<<<<<<<<< * if inj_args_len == 0: # <<<<<<<<<<<<<<
@ -8362,7 +8390,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
__pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0); __pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0);
if (__pyx_t_1) { if (__pyx_t_1) {
/* "providers.pxd":194 /* "providers.pxd":198
* *
* if inj_args_len == 0: * if inj_args_len == 0:
* return args # <<<<<<<<<<<<<< * return args # <<<<<<<<<<<<<<
@ -8374,7 +8402,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
__pyx_r = __pyx_v_args; __pyx_r = __pyx_v_args;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":193 /* "providers.pxd":197
* cdef PositionalInjection injection * cdef PositionalInjection injection
* *
* if inj_args_len == 0: # <<<<<<<<<<<<<< * if inj_args_len == 0: # <<<<<<<<<<<<<<
@ -8383,19 +8411,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
*/ */
} }
/* "providers.pxd":196 /* "providers.pxd":200
* return args * return args
* *
* positional_args = list() # <<<<<<<<<<<<<< * positional_args = list() # <<<<<<<<<<<<<<
* for index in range(inj_args_len): * for index in range(inj_args_len):
* injection = <PositionalInjection>inj_args[index] * injection = <PositionalInjection>inj_args[index]
*/ */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 196, __pyx_L1_error) __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_2);
__pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_v_positional_args = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0; __pyx_t_2 = 0;
/* "providers.pxd":197 /* "providers.pxd":201
* *
* positional_args = list() * positional_args = list()
* for index in range(inj_args_len): # <<<<<<<<<<<<<< * for index in range(inj_args_len): # <<<<<<<<<<<<<<
@ -8406,7 +8434,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4; __pyx_v_index = __pyx_t_4;
/* "providers.pxd":198 /* "providers.pxd":202
* positional_args = list() * positional_args = list()
* for index in range(inj_args_len): * for index in range(inj_args_len):
* injection = <PositionalInjection>inj_args[index] # <<<<<<<<<<<<<< * injection = <PositionalInjection>inj_args[index] # <<<<<<<<<<<<<<
@ -8415,36 +8443,36 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
*/ */
if (unlikely(__pyx_v_inj_args == Py_None)) { if (unlikely(__pyx_v_inj_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 198, __pyx_L1_error) __PYX_ERR(1, 202, __pyx_L1_error)
} }
__pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index); __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index);
__Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_t_2)); __Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_t_2));
__pyx_t_2 = 0; __pyx_t_2 = 0;
/* "providers.pxd":199 /* "providers.pxd":203
* for index in range(inj_args_len): * for index in range(inj_args_len):
* injection = <PositionalInjection>inj_args[index] * injection = <PositionalInjection>inj_args[index]
* positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<< * positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<<
* positional_args.extend(args) * positional_args.extend(args)
* *
*/ */
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 199, __pyx_L1_error) __pyx_t_2 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 199, __pyx_L1_error) __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 203, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} }
/* "providers.pxd":200 /* "providers.pxd":204
* injection = <PositionalInjection>inj_args[index] * injection = <PositionalInjection>inj_args[index]
* positional_args.append(__get_value(injection)) * positional_args.append(__get_value(injection))
* positional_args.extend(args) # <<<<<<<<<<<<<< * positional_args.extend(args) # <<<<<<<<<<<<<<
* *
* return tuple(positional_args) * return tuple(positional_args)
*/ */
__pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 200, __pyx_L1_error) __pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 204, __pyx_L1_error)
/* "providers.pxd":202 /* "providers.pxd":206
* positional_args.extend(args) * positional_args.extend(args)
* *
* return tuple(positional_args) # <<<<<<<<<<<<<< * return tuple(positional_args) # <<<<<<<<<<<<<<
@ -8452,13 +8480,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
* *
*/ */
__Pyx_XDECREF(__pyx_r); __Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 202, __pyx_L1_error) __pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((PyObject*)__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0; __pyx_t_2 = 0;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":186 /* "providers.pxd":190
* @cython.boundscheck(False) * @cython.boundscheck(False)
* @cython.wraparound(False) * @cython.wraparound(False)
* cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<< * cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<<
@ -8479,7 +8507,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":207 /* "providers.pxd":211
* @cython.boundscheck(False) * @cython.boundscheck(False)
* @cython.wraparound(False) * @cython.wraparound(False)
* cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<<
@ -8501,7 +8529,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
int __pyx_t_6; int __pyx_t_6;
__Pyx_RefNannySetupContext("__provide_keyword_args", 0); __Pyx_RefNannySetupContext("__provide_keyword_args", 0);
/* "providers.pxd":214 /* "providers.pxd":218
* cdef NamedInjection kw_injection * cdef NamedInjection kw_injection
* *
* if len(kwargs) == 0: # <<<<<<<<<<<<<< * if len(kwargs) == 0: # <<<<<<<<<<<<<<
@ -8510,13 +8538,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
*/ */
if (unlikely(__pyx_v_kwargs == Py_None)) { if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 214, __pyx_L1_error) __PYX_ERR(1, 218, __pyx_L1_error)
} }
__pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 214, __pyx_L1_error) __pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 218, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_1 == 0) != 0); __pyx_t_2 = ((__pyx_t_1 == 0) != 0);
if (__pyx_t_2) { if (__pyx_t_2) {
/* "providers.pxd":215 /* "providers.pxd":219
* *
* if len(kwargs) == 0: * if len(kwargs) == 0:
* for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<<
@ -8527,7 +8555,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4; __pyx_v_index = __pyx_t_4;
/* "providers.pxd":216 /* "providers.pxd":220
* if len(kwargs) == 0: * if len(kwargs) == 0:
* for index in range(inj_kwargs_len): * for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index] # <<<<<<<<<<<<<< * kw_injection = <NamedInjection>inj_kwargs[index] # <<<<<<<<<<<<<<
@ -8536,43 +8564,43 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
*/ */
if (unlikely(__pyx_v_inj_kwargs == Py_None)) { if (unlikely(__pyx_v_inj_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 216, __pyx_L1_error) __PYX_ERR(1, 220, __pyx_L1_error)
} }
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index);
__Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_5)); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_5));
__pyx_t_5 = 0; __pyx_t_5 = 0;
/* "providers.pxd":217 /* "providers.pxd":221
* for index in range(inj_kwargs_len): * for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index] * kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) # <<<<<<<<<<<<<< * name = __get_name(kw_injection) # <<<<<<<<<<<<<<
* kwargs[name] = __get_value(kw_injection) * kwargs[name] = __get_value(kw_injection)
* else: * else:
*/ */
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error) __pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__pyx_t_5 = 0; __pyx_t_5 = 0;
/* "providers.pxd":218 /* "providers.pxd":222
* kw_injection = <NamedInjection>inj_kwargs[index] * kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) * name = __get_name(kw_injection)
* kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<<
* else: * else:
* for index in range(inj_kwargs_len): * for index in range(inj_kwargs_len):
*/ */
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_kwargs == Py_None)) { if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 218, __pyx_L1_error) __PYX_ERR(1, 222, __pyx_L1_error)
} }
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 218, __pyx_L1_error) if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 222, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} }
/* "providers.pxd":214 /* "providers.pxd":218
* cdef NamedInjection kw_injection * cdef NamedInjection kw_injection
* *
* if len(kwargs) == 0: # <<<<<<<<<<<<<< * if len(kwargs) == 0: # <<<<<<<<<<<<<<
@ -8582,7 +8610,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
goto __pyx_L3; goto __pyx_L3;
} }
/* "providers.pxd":220 /* "providers.pxd":224
* kwargs[name] = __get_value(kw_injection) * kwargs[name] = __get_value(kw_injection)
* else: * else:
* for index in range(inj_kwargs_len): # <<<<<<<<<<<<<< * for index in range(inj_kwargs_len): # <<<<<<<<<<<<<<
@ -8594,7 +8622,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4; __pyx_v_index = __pyx_t_4;
/* "providers.pxd":221 /* "providers.pxd":225
* else: * else:
* for index in range(inj_kwargs_len): * for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index] # <<<<<<<<<<<<<< * kw_injection = <NamedInjection>inj_kwargs[index] # <<<<<<<<<<<<<<
@ -8603,26 +8631,26 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
*/ */
if (unlikely(__pyx_v_inj_kwargs == Py_None)) { if (unlikely(__pyx_v_inj_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 221, __pyx_L1_error) __PYX_ERR(1, 225, __pyx_L1_error)
} }
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index); __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index);
__Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_5)); __Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_5));
__pyx_t_5 = 0; __pyx_t_5 = 0;
/* "providers.pxd":222 /* "providers.pxd":226
* for index in range(inj_kwargs_len): * for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index] * kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) # <<<<<<<<<<<<<< * name = __get_name(kw_injection) # <<<<<<<<<<<<<<
* if name not in kwargs: * if name not in kwargs:
* kwargs[name] = __get_value(kw_injection) * kwargs[name] = __get_value(kw_injection)
*/ */
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 222, __pyx_L1_error) __pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__pyx_t_5 = 0; __pyx_t_5 = 0;
/* "providers.pxd":223 /* "providers.pxd":227
* kw_injection = <NamedInjection>inj_kwargs[index] * kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) * name = __get_name(kw_injection)
* if name not in kwargs: # <<<<<<<<<<<<<< * if name not in kwargs: # <<<<<<<<<<<<<<
@ -8631,29 +8659,29 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
*/ */
if (unlikely(__pyx_v_kwargs == Py_None)) { if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(1, 223, __pyx_L1_error) __PYX_ERR(1, 227, __pyx_L1_error)
} }
__pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 223, __pyx_L1_error) __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 227, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_6 = (__pyx_t_2 != 0);
if (__pyx_t_6) { if (__pyx_t_6) {
/* "providers.pxd":224 /* "providers.pxd":228
* name = __get_name(kw_injection) * name = __get_name(kw_injection)
* if name not in kwargs: * if name not in kwargs:
* kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<< * kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<<
* *
* return kwargs * return kwargs
*/ */
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 224, __pyx_L1_error) __pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_kwargs == Py_None)) { if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 224, __pyx_L1_error) __PYX_ERR(1, 228, __pyx_L1_error)
} }
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 224, __pyx_L1_error) if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(1, 228, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "providers.pxd":223 /* "providers.pxd":227
* kw_injection = <NamedInjection>inj_kwargs[index] * kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) * name = __get_name(kw_injection)
* if name not in kwargs: # <<<<<<<<<<<<<< * if name not in kwargs: # <<<<<<<<<<<<<<
@ -8665,7 +8693,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
} }
__pyx_L3:; __pyx_L3:;
/* "providers.pxd":226 /* "providers.pxd":230
* kwargs[name] = __get_value(kw_injection) * kwargs[name] = __get_value(kw_injection)
* *
* return kwargs # <<<<<<<<<<<<<< * return kwargs # <<<<<<<<<<<<<<
@ -8677,7 +8705,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
__pyx_r = __pyx_v_kwargs; __pyx_r = __pyx_v_kwargs;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":207 /* "providers.pxd":211
* @cython.boundscheck(False) * @cython.boundscheck(False)
* @cython.wraparound(False) * @cython.wraparound(False)
* cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<< * cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<<
@ -8698,7 +8726,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provid
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":231 /* "providers.pxd":235
* @cython.boundscheck(False) * @cython.boundscheck(False)
* @cython.wraparound(False) * @cython.wraparound(False)
* cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<<
@ -8718,7 +8746,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___inject
int __pyx_t_5; int __pyx_t_5;
__Pyx_RefNannySetupContext("__inject_attributes", 0); __Pyx_RefNannySetupContext("__inject_attributes", 0);
/* "providers.pxd":235 /* "providers.pxd":239
* int attributes_len): * int attributes_len):
* cdef NamedInjection attr_injection * cdef NamedInjection attr_injection
* for index in range(attributes_len): # <<<<<<<<<<<<<< * for index in range(attributes_len): # <<<<<<<<<<<<<<
@ -8729,7 +8757,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___inject
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_index = __pyx_t_2; __pyx_v_index = __pyx_t_2;
/* "providers.pxd":236 /* "providers.pxd":240
* cdef NamedInjection attr_injection * cdef NamedInjection attr_injection
* for index in range(attributes_len): * for index in range(attributes_len):
* attr_injection = <NamedInjection>attributes[index] # <<<<<<<<<<<<<< * attr_injection = <NamedInjection>attributes[index] # <<<<<<<<<<<<<<
@ -8738,46 +8766,46 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___inject
*/ */
if (unlikely(__pyx_v_attributes == Py_None)) { if (unlikely(__pyx_v_attributes == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 236, __pyx_L1_error) __PYX_ERR(1, 240, __pyx_L1_error)
} }
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index); __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index);
__Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_3)); __Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_3));
__pyx_t_3 = 0; __pyx_t_3 = 0;
/* "providers.pxd":238 /* "providers.pxd":242
* attr_injection = <NamedInjection>attributes[index] * attr_injection = <NamedInjection>attributes[index]
* setattr(instance, * setattr(instance,
* __get_name(attr_injection), # <<<<<<<<<<<<<< * __get_name(attr_injection), # <<<<<<<<<<<<<<
* __get_value(attr_injection)) * __get_value(attr_injection))
* *
*/ */
__pyx_t_3 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 238, __pyx_L1_error) __pyx_t_3 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_3);
/* "providers.pxd":239 /* "providers.pxd":243
* setattr(instance, * setattr(instance,
* __get_name(attr_injection), * __get_name(attr_injection),
* __get_value(attr_injection)) # <<<<<<<<<<<<<< * __get_value(attr_injection)) # <<<<<<<<<<<<<<
* *
* *
*/ */
__pyx_t_4 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 239, __pyx_L1_error) __pyx_t_4 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_4);
/* "providers.pxd":237 /* "providers.pxd":241
* for index in range(attributes_len): * for index in range(attributes_len):
* attr_injection = <NamedInjection>attributes[index] * attr_injection = <NamedInjection>attributes[index]
* setattr(instance, # <<<<<<<<<<<<<< * setattr(instance, # <<<<<<<<<<<<<<
* __get_name(attr_injection), * __get_name(attr_injection),
* __get_value(attr_injection)) * __get_value(attr_injection))
*/ */
__pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 237, __pyx_L1_error) __pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 241, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} }
/* "providers.pxd":231 /* "providers.pxd":235
* @cython.boundscheck(False) * @cython.boundscheck(False)
* @cython.wraparound(False) * @cython.wraparound(False)
* cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<< * cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<<
@ -8800,7 +8828,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___inject
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":242 /* "providers.pxd":246
* *
* *
* cdef inline object __callable_call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * cdef inline object __callable_call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
@ -8817,7 +8845,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__callable_call", 0); __Pyx_RefNannySetupContext("__callable_call", 0);
/* "providers.pxd":247 /* "providers.pxd":251
* *
* positional_args = __provide_positional_args(args, * positional_args = __provide_positional_args(args,
* self.__args, # <<<<<<<<<<<<<< * self.__args, # <<<<<<<<<<<<<<
@ -8827,20 +8855,20 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
__pyx_t_1 = __pyx_v_self->__pyx___args; __pyx_t_1 = __pyx_v_self->__pyx___args;
__Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1);
/* "providers.pxd":246 /* "providers.pxd":250
* cdef dict keyword_args * cdef dict keyword_args
* *
* positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<< * positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<<
* self.__args, * self.__args,
* self.__args_len) * self.__args_len)
*/ */
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error) __pyx_t_2 = __pyx_f_19dependency_injector_9providers___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_positional_args = ((PyObject*)__pyx_t_2); __pyx_v_positional_args = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0; __pyx_t_2 = 0;
/* "providers.pxd":250 /* "providers.pxd":254
* self.__args_len) * self.__args_len)
* keyword_args = __provide_keyword_args(kwargs, * keyword_args = __provide_keyword_args(kwargs,
* self.__kwargs, # <<<<<<<<<<<<<< * self.__kwargs, # <<<<<<<<<<<<<<
@ -8850,20 +8878,20 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
__pyx_t_2 = __pyx_v_self->__pyx___kwargs; __pyx_t_2 = __pyx_v_self->__pyx___kwargs;
__Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2);
/* "providers.pxd":249 /* "providers.pxd":253
* self.__args, * self.__args,
* self.__args_len) * self.__args_len)
* keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<< * keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<<
* self.__kwargs, * self.__kwargs,
* self.__kwargs_len) * self.__kwargs_len)
*/ */
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error) __pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_keyword_args = ((PyObject*)__pyx_t_1); __pyx_v_keyword_args = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0; __pyx_t_1 = 0;
/* "providers.pxd":253 /* "providers.pxd":257
* self.__kwargs_len) * self.__kwargs_len)
* *
* return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<< * return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<<
@ -8873,19 +8901,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
__Pyx_XDECREF(__pyx_r); __Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_positional_args == Py_None)) { if (unlikely(__pyx_v_positional_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(1, 253, __pyx_L1_error) __PYX_ERR(1, 257, __pyx_L1_error)
} }
if (unlikely(__pyx_v_keyword_args == Py_None)) { if (unlikely(__pyx_v_keyword_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(1, 253, __pyx_L1_error) __PYX_ERR(1, 257, __pyx_L1_error)
} }
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1; __pyx_r = __pyx_t_1;
__pyx_t_1 = 0; __pyx_t_1 = 0;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":242 /* "providers.pxd":246
* *
* *
* cdef inline object __callable_call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * cdef inline object __callable_call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
@ -8907,7 +8935,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
return __pyx_r; return __pyx_r;
} }
/* "providers.pxd":256 /* "providers.pxd":260
* *
* *
* cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
@ -8924,7 +8952,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factor
int __pyx_t_3; int __pyx_t_3;
__Pyx_RefNannySetupContext("__factory_call", 0); __Pyx_RefNannySetupContext("__factory_call", 0);
/* "providers.pxd":259 /* "providers.pxd":263
* cdef object instance * cdef object instance
* *
* instance = __callable_call(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<< * instance = __callable_call(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<<
@ -8933,13 +8961,13 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factor
*/ */
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___instantiator); __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___instantiator);
__Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___callable_call(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 259, __pyx_L1_error) __pyx_t_2 = __pyx_f_19dependency_injector_9providers___callable_call(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_instance = __pyx_t_2; __pyx_v_instance = __pyx_t_2;
__pyx_t_2 = 0; __pyx_t_2 = 0;
/* "providers.pxd":261 /* "providers.pxd":265
* instance = __callable_call(self.__instantiator, args, kwargs) * instance = __callable_call(self.__instantiator, args, kwargs)
* *
* if self.__attributes_len > 0: # <<<<<<<<<<<<<< * if self.__attributes_len > 0: # <<<<<<<<<<<<<<
@ -8949,7 +8977,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factor
__pyx_t_3 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0); __pyx_t_3 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0);
if (__pyx_t_3) { if (__pyx_t_3) {
/* "providers.pxd":263 /* "providers.pxd":267
* if self.__attributes_len > 0: * if self.__attributes_len > 0:
* __inject_attributes(instance, * __inject_attributes(instance,
* self.__attributes, # <<<<<<<<<<<<<< * self.__attributes, # <<<<<<<<<<<<<<
@ -8959,19 +8987,19 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factor
__pyx_t_2 = __pyx_v_self->__pyx___attributes; __pyx_t_2 = __pyx_v_self->__pyx___attributes;
__Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2);
/* "providers.pxd":262 /* "providers.pxd":266
* *
* if self.__attributes_len > 0: * if self.__attributes_len > 0:
* __inject_attributes(instance, # <<<<<<<<<<<<<< * __inject_attributes(instance, # <<<<<<<<<<<<<<
* self.__attributes, * self.__attributes,
* self.__attributes_len) * self.__attributes_len)
*/ */
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 262, __pyx_L1_error) __pyx_t_1 = __pyx_f_19dependency_injector_9providers___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "providers.pxd":261 /* "providers.pxd":265
* instance = __callable_call(self.__instantiator, args, kwargs) * instance = __callable_call(self.__instantiator, args, kwargs)
* *
* if self.__attributes_len > 0: # <<<<<<<<<<<<<< * if self.__attributes_len > 0: # <<<<<<<<<<<<<<
@ -8980,7 +9008,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factor
*/ */
} }
/* "providers.pxd":266 /* "providers.pxd":270
* self.__attributes_len) * self.__attributes_len)
* *
* return instance # <<<<<<<<<<<<<< * return instance # <<<<<<<<<<<<<<
@ -8990,7 +9018,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factor
__pyx_r = __pyx_v_instance; __pyx_r = __pyx_v_instance;
goto __pyx_L0; goto __pyx_L0;
/* "providers.pxd":256 /* "providers.pxd":260
* *
* *
* cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
@ -9713,7 +9741,7 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 55, __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_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, 358, __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, 197, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 201, __pyx_L1_error)
return 0; return 0;
__pyx_L1_error:; __pyx_L1_error:;
return -1; return -1;
@ -10090,35 +10118,37 @@ PyMODINIT_FUNC PyInit_containers(void)
__pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable)) __PYX_ERR(1, 50, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable)) __PYX_ERR(1, 50, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_AbstractCallable = __Pyx_ImportType("dependency_injector.providers", "AbstractCallable", sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_AbstractCallable)) __PYX_ERR(1, 54, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_AbstractCallable = __Pyx_ImportType("dependency_injector.providers", "AbstractCallable", sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_AbstractCallable)) __PYX_ERR(1, 54, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_AbstractCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable)) __PYX_ERR(1, 54, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_AbstractCallable = (struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_AbstractCallable->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable)) __PYX_ERR(1, 54, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Configuration = __Pyx_ImportType("dependency_injector.providers", "Configuration", sizeof(struct __pyx_obj_19dependency_injector_9providers_Configuration), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Configuration)) __PYX_ERR(1, 59, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_CallableDelegate = __Pyx_ImportType("dependency_injector.providers", "CallableDelegate", sizeof(struct __pyx_obj_19dependency_injector_9providers_CallableDelegate), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_CallableDelegate)) __PYX_ERR(1, 58, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_Configuration = (struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_Configuration->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_Configuration)) __PYX_ERR(1, 59, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_CallableDelegate = (struct __pyx_vtabstruct_19dependency_injector_9providers_CallableDelegate*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_CallableDelegate->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_CallableDelegate)) __PYX_ERR(1, 58, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Factory = __Pyx_ImportType("dependency_injector.providers", "Factory", sizeof(struct __pyx_obj_19dependency_injector_9providers_Factory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Factory)) __PYX_ERR(1, 71, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_Configuration = __Pyx_ImportType("dependency_injector.providers", "Configuration", sizeof(struct __pyx_obj_19dependency_injector_9providers_Configuration), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Configuration)) __PYX_ERR(1, 63, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_Factory = (struct __pyx_vtabstruct_19dependency_injector_9providers_Factory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_Factory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_Factory)) __PYX_ERR(1, 71, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_Configuration = (struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_Configuration->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_Configuration)) __PYX_ERR(1, 63, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedFactory = __Pyx_ImportType("dependency_injector.providers", "DelegatedFactory", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedFactory)) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_Factory = __Pyx_ImportType("dependency_injector.providers", "Factory", sizeof(struct __pyx_obj_19dependency_injector_9providers_Factory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Factory)) __PYX_ERR(1, 75, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedFactory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory)) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_Factory = (struct __pyx_vtabstruct_19dependency_injector_9providers_Factory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_Factory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_Factory)) __PYX_ERR(1, 75, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_AbstractFactory = __Pyx_ImportType("dependency_injector.providers", "AbstractFactory", sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_AbstractFactory)) __PYX_ERR(1, 84, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_DelegatedFactory = __Pyx_ImportType("dependency_injector.providers", "DelegatedFactory", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedFactory)) __PYX_ERR(1, 84, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory = (struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_AbstractFactory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory)) __PYX_ERR(1, 84, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedFactory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory)) __PYX_ERR(1, 84, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_FactoryDelegate = __Pyx_ImportType("dependency_injector.providers", "FactoryDelegate", sizeof(struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_FactoryDelegate)) __PYX_ERR(1, 88, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_AbstractFactory = __Pyx_ImportType("dependency_injector.providers", "AbstractFactory", sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_AbstractFactory)) __PYX_ERR(1, 88, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate = (struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_FactoryDelegate->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate)) __PYX_ERR(1, 88, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_AbstractFactory = (struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_AbstractFactory->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory)) __PYX_ERR(1, 88, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_BaseSingleton = __Pyx_ImportType("dependency_injector.providers", "BaseSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_BaseSingleton)) __PYX_ERR(1, 93, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_FactoryDelegate = __Pyx_ImportType("dependency_injector.providers", "FactoryDelegate", sizeof(struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_FactoryDelegate)) __PYX_ERR(1, 92, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_BaseSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton)) __PYX_ERR(1, 93, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate = (struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_FactoryDelegate->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate)) __PYX_ERR(1, 92, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Singleton = __Pyx_ImportType("dependency_injector.providers", "Singleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_Singleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Singleton)) __PYX_ERR(1, 97, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_BaseSingleton = __Pyx_ImportType("dependency_injector.providers", "BaseSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_BaseSingleton)) __PYX_ERR(1, 97, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_Singleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_Singleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_Singleton)) __PYX_ERR(1, 97, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_BaseSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_BaseSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton)) __PYX_ERR(1, 97, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton = __Pyx_ImportType("dependency_injector.providers", "DelegatedSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton)) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_Singleton = __Pyx_ImportType("dependency_injector.providers", "Singleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_Singleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Singleton)) __PYX_ERR(1, 101, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton)) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_Singleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_Singleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_Singleton)) __PYX_ERR(1, 101, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton = __Pyx_ImportType("dependency_injector.providers", "ThreadSafeSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton)) __PYX_ERR(1, 107, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_DelegatedSingleton = __Pyx_ImportType("dependency_injector.providers", "DelegatedSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton)) __PYX_ERR(1, 107, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton)) __PYX_ERR(1, 107, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton)) __PYX_ERR(1, 107, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton = __Pyx_ImportType("dependency_injector.providers", "DelegatedThreadSafeSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton)) __PYX_ERR(1, 114, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton = __Pyx_ImportType("dependency_injector.providers", "ThreadSafeSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton)) __PYX_ERR(1, 111, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton)) __PYX_ERR(1, 114, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton)) __PYX_ERR(1, 111, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton = __Pyx_ImportType("dependency_injector.providers", "ThreadLocalSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton)) __PYX_ERR(1, 118, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton = __Pyx_ImportType("dependency_injector.providers", "DelegatedThreadSafeSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton)) __PYX_ERR(1, 118, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton)) __PYX_ERR(1, 118, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton)) __PYX_ERR(1, 118, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton = __Pyx_ImportType("dependency_injector.providers", "DelegatedThreadLocalSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton)) __PYX_ERR(1, 124, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton = __Pyx_ImportType("dependency_injector.providers", "ThreadLocalSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton)) __PYX_ERR(1, 122, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton)) __PYX_ERR(1, 124, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton)) __PYX_ERR(1, 122, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_AbstractSingleton = __Pyx_ImportType("dependency_injector.providers", "AbstractSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_AbstractSingleton)) __PYX_ERR(1, 128, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton = __Pyx_ImportType("dependency_injector.providers", "DelegatedThreadLocalSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton)) __PYX_ERR(1, 128, __pyx_L1_error)
__pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_AbstractSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton)) __PYX_ERR(1, 128, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton)) __PYX_ERR(1, 128, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Injection = __Pyx_ImportType("dependency_injector.providers", "Injection", sizeof(struct __pyx_obj_19dependency_injector_9providers_Injection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Injection)) __PYX_ERR(1, 133, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_AbstractSingleton = __Pyx_ImportType("dependency_injector.providers", "AbstractSingleton", sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_AbstractSingleton)) __PYX_ERR(1, 132, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_PositionalInjection = __Pyx_ImportType("dependency_injector.providers", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_PositionalInjection)) __PYX_ERR(1, 140, __pyx_L1_error) __pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton = (struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractSingleton*)__Pyx_GetVtable(__pyx_ptype_19dependency_injector_9providers_AbstractSingleton->tp_dict); if (unlikely(!__pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton)) __PYX_ERR(1, 132, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_NamedInjection = __Pyx_ImportType("dependency_injector.providers", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_NamedInjection)) __PYX_ERR(1, 144, __pyx_L1_error) __pyx_ptype_19dependency_injector_9providers_Injection = __Pyx_ImportType("dependency_injector.providers", "Injection", sizeof(struct __pyx_obj_19dependency_injector_9providers_Injection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_Injection)) __PYX_ERR(1, 137, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_PositionalInjection = __Pyx_ImportType("dependency_injector.providers", "PositionalInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_PositionalInjection)) __PYX_ERR(1, 144, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_NamedInjection = __Pyx_ImportType("dependency_injector.providers", "NamedInjection", sizeof(struct __pyx_obj_19dependency_injector_9providers_NamedInjection), 1); if (unlikely(!__pyx_ptype_19dependency_injector_9providers_NamedInjection)) __PYX_ERR(1, 148, __pyx_L1_error)
/*--- Variable import code ---*/ /*--- Variable import code ---*/
__pyx_t_1 = __Pyx_ImportModule("dependency_injector.providers"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_t_1 = __Pyx_ImportModule("dependency_injector.providers"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
if (__Pyx_ImportVoidPtr(__pyx_t_1, "CLASS_TYPES", (void **)&__pyx_vp_19dependency_injector_9providers_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "CLASS_TYPES", (void **)&__pyx_vp_19dependency_injector_9providers_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
@ -10678,7 +10708,7 @@ PyMODINIT_FUNC PyInit_containers(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "providers.pxd":256 /* "providers.pxd":260
* *
* *
* cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<< * cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<<

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,10 @@ cdef class AbstractCallable(Callable):
cpdef object _provide(self, tuple args, dict kwargs) cpdef object _provide(self, tuple args, dict kwargs)
cdef class CallableDelegate(Delegate):
pass
# Configuration providers # Configuration providers
cdef class Configuration(Provider): cdef class Configuration(Provider):
cdef str __name cdef str __name

View File

@ -647,6 +647,28 @@ cdef class AbstractCallable(Callable):
'to overriding provider') 'to overriding provider')
cdef class CallableDelegate(Delegate):
"""Callable delegate injects delegating callable "as is".
.. py:attribute:: provides
Value that have to be provided.
:type: object
"""
def __init__(self, callable):
"""Initializer.
:param provides: Value that have to be provided.
:type provides: object
"""
if isinstance(callable, Callable) is False:
raise Error('{0} can wrap only {1} providers'.format(
self.__class__, Callable))
super(Delegate, self).__init__(callable)
cdef class Configuration(Provider): cdef class Configuration(Provider):
"""Configuration provider. """Configuration provider.

View File

@ -251,3 +251,18 @@ class AbstractCallableTests(unittest.TestCase):
'AbstractCallable({0}) at {1}>'.format( 'AbstractCallable({0}) at {1}>'.format(
repr(_example), repr(_example),
hex(id(provider)))) hex(id(provider))))
class CallableDelegateTests(unittest.TestCase):
def setUp(self):
self.delegated = providers.Callable(_example)
self.delegate = providers.CallableDelegate(self.delegated)
def test_is_delegate(self):
self.assertIsInstance(self.delegate, providers.Delegate)
def test_init_with_not_factory(self):
self.assertRaises(errors.Error,
providers.CallableDelegate,
providers.Object(object()))