From aa251a44badcac5bc6b895d3e0f2a3e2df84b502 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Sat, 24 Jul 2021 16:32:44 -0400 Subject: [PATCH] Fix reverse shutdown order bug in container.shutdown_resources() --- src/dependency_injector/containers.c | 6614 +++++++++-------- src/dependency_injector/containers.pyx | 33 +- .../test_dynamic_async_resources_py36.py | 12 +- tests/unit/containers/test_dynamic_py2_py3.py | 6 +- 4 files changed, 3364 insertions(+), 3301 deletions(-) diff --git a/src/dependency_injector/containers.c b/src/dependency_injector/containers.c index efde8780..89238d76 100644 --- a/src/dependency_injector/containers.c +++ b/src/dependency_injector/containers.c @@ -870,14 +870,15 @@ struct __pyx_obj_19dependency_injector_9providers_SingletonResetContext; struct __pyx_obj_19dependency_injector_9providers_SingletonFullResetContext; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct__traverse; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override; -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override; +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy; struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_void____object____object____object____object___to_py; struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_void____object____object___to_py; struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_void____object____object____object___to_py; @@ -1574,81 +1575,48 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct__traverse * * def shutdown_resources(self): # <<<<<<<<<<<<<< * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): + * def _independent_resources(resources): */ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources { PyObject_HEAD - PyObject *__pyx_v__any_initialized; - PyObject *__pyx_v__no_initialized_dependencies; - PyObject *__pyx_v__without_initialized_dependencies; + PyObject *__pyx_v__independent_resources; + PyObject *__pyx_v_resources; }; -/* "dependency_injector/containers.pyx":302 - * return list(filter(_no_initialized_dependencies, resources)) - * - * def _any_initialized(resources): # <<<<<<<<<<<<<< - * return any(resource.initialized for resource in resources) - * +/* "dependency_injector/containers.pyx":293 + * def shutdown_resources(self): + * """Shutdown all container resources.""" + * def _independent_resources(resources): # <<<<<<<<<<<<<< + * for resource in resources: + * for other_resource in resources: */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized { +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources { PyObject_HEAD + PyObject *__pyx_v_other_resource; + PyObject *__pyx_v_resource; PyObject *__pyx_v_resources; + 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 *); }; /* "dependency_injector/containers.pyx":303 - * - * def _any_initialized(resources): - * return any(resource.initialized for resource in resources) # <<<<<<<<<<<<<< - * - * def _any_in_async_mode(resources): - */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr { - PyObject_HEAD - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *__pyx_outer_scope; - PyObject *__pyx_v_resource; -}; - - -/* "dependency_injector/containers.pyx":305 - * return any(resource.initialized for resource in resources) - * - * def _any_in_async_mode(resources): # <<<<<<<<<<<<<< - * return any(resource.is_async_mode_enabled() for resource in resources) - * - */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode { - PyObject_HEAD - PyObject *__pyx_v_resources; -}; - - -/* "dependency_injector/containers.pyx":306 - * - * def _any_in_async_mode(resources): - * return any(resource.is_async_mode_enabled() for resource in resources) # <<<<<<<<<<<<<< - * - * async def _async_ordered_shutdown(resources): - */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr { - PyObject_HEAD - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *__pyx_outer_scope; - PyObject *__pyx_v_resource; -}; - - -/* "dependency_injector/containers.pyx":308 - * return any(resource.is_async_mode_enabled() for resource in resources) + * yield resource * * async def _async_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown { +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown { PyObject_HEAD struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_outer_scope; PyObject *__pyx_v_futures; + PyObject *__pyx_v_genexpr; PyObject *__pyx_v_resource; PyObject *__pyx_v_resources; PyObject *__pyx_v_resources_to_shutdown; @@ -1656,41 +1624,97 @@ struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ }; -/* "dependency_injector/containers.pyx":533 +/* "dependency_injector/containers.pyx":304 + * + * async def _async_ordered_shutdown(resources): + * while any(resource.initialized for resource in resources): # <<<<<<<<<<<<<< + * resources_to_shutdown = list(_independent_resources(resources)) + * if not resources_to_shutdown: + */ +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr { + PyObject_HEAD + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *__pyx_outer_scope; + PyObject *__pyx_v_resource; +}; + + +/* "dependency_injector/containers.pyx":315 + * await asyncio.gather(*futures) + * + * def _sync_ordered_shutdown(resources): # <<<<<<<<<<<<<< + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) + */ +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown { + PyObject_HEAD + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_outer_scope; + PyObject *__pyx_v_resources; +}; + + +/* "dependency_injector/containers.pyx":316 + * + * def _sync_ordered_shutdown(resources): + * while any(resource.initialized for resource in resources): # <<<<<<<<<<<<<< + * resources_to_shutdown = list(_independent_resources(resources)) + * if not resources_to_shutdown: + */ +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr { + PyObject_HEAD + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *__pyx_outer_scope; + PyObject *__pyx_v_resource; +}; + + +/* "dependency_injector/containers.pyx":324 + * + * resources = list(self.traverse(types=[providers.Resource])) + * if any(resource.is_async_mode_enabled() for resource in resources): # <<<<<<<<<<<<<< + * return _async_ordered_shutdown(resources) + * else: + */ +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr { + PyObject_HEAD + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_outer_scope; + PyObject *__pyx_v_resource; +}; + + +/* "dependency_injector/containers.pyx":528 * } * * def traverse(cls, types=None): # <<<<<<<<<<<<<< * """Return providers traversal generator.""" * yield from providers.traverse(*cls.providers.values(), types=types) */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse { +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse { PyObject_HEAD PyObject *__pyx_v_cls; PyObject *__pyx_v_types; }; -/* "dependency_injector/containers.pyx":724 +/* "dependency_injector/containers.pyx":719 * * * def override(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` overriding decorator. * */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override { +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override { PyObject_HEAD PyObject *__pyx_v_container; }; -/* "dependency_injector/containers.pyx":741 +/* "dependency_injector/containers.pyx":736 * * * def copy(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` copying decorator. * */ -struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy { +struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy { PyObject_HEAD PyObject *__pyx_v__get_providers_memo; PyObject *__pyx_v_container; @@ -3249,14 +3273,15 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___future /* Module declarations from 'dependency_injector.containers' */ static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct__traverse = 0; static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3_genexpr = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_5_genexpr = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_7_traverse = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_8_override = 0; -static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_9_copy = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4_genexpr = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_6_genexpr = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_7_genexpr = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_8_traverse = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_9_override = 0; +static PyTypeObject *__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_10_copy = 0; static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_void____object____object____object____object___to_py = 0; static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_void____object____object___to_py = 0; static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_void____object____object____object___to_py = 0; @@ -3280,17 +3305,16 @@ static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_AttributeError; -static PyObject *__pyx_builtin_filter; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_open; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_zip; static const char __pyx_k_id[] = "id"; -static const char __pyx_k__17[] = "\""; -static const char __pyx_k__18[] = ", "; -static const char __pyx_k__27[] = "__"; -static const char __pyx_k__36[] = ""; +static const char __pyx_k__11[] = "\""; +static const char __pyx_k__12[] = ", "; +static const char __pyx_k__21[] = "__"; +static const char __pyx_k__30[] = ""; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; @@ -3301,7 +3325,7 @@ static const char __pyx_k_six[] = "six"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_Self[] = "Self"; -static const char __pyx_k__124[] = "_"; +static const char __pyx_k__118[] = "_"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_call[] = "call"; @@ -3341,7 +3365,6 @@ static const char __pyx_k_Future[] = "Future"; static const char __pyx_k_copied[] = "copied"; static const char __pyx_k_errors[] = "errors"; static const char __pyx_k_extend[] = "extend"; -static const char __pyx_k_filter[] = "filter"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_future[] = "future"; static const char __pyx_k_gather[] = "gather"; @@ -3446,10 +3469,10 @@ static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_container_name[] = "container_name"; static const char __pyx_k_from_providers[] = "from_providers"; static const char __pyx_k_init_resources[] = "init_resources"; +static const char __pyx_k_other_resource[] = "other_resource"; static const char __pyx_k_providers_copy[] = "providers_copy"; static const char __pyx_k_reset_override[] = "reset_override"; static const char __pyx_k_CHILD_PROVIDERS[] = "CHILD_PROVIDERS"; -static const char __pyx_k_any_initialized[] = "_any_initialized"; static const char __pyx_k_source_provider[] = "source_provider"; static const char __pyx_k_undefined_names[] = "undefined_names"; static const char __pyx_k_DynamicContainer[] = "DynamicContainer"; @@ -3462,7 +3485,6 @@ static const char __pyx_k_source_providers[] = "source_providers"; static const char __pyx_k_wired_to_modules[] = "wired_to_modules"; static const char __pyx_k_Containers_module[] = "Containers module."; static const char __pyx_k_add_done_callback[] = "add_done_callback"; -static const char __pyx_k_any_in_async_mode[] = "_any_in_async_mode"; static const char __pyx_k_apply_overridings[] = "apply_overridings"; static const char __pyx_k_wired_to_packages[] = "wired_to_packages"; static const char __pyx_k_Abstract_container[] = "Abstract container."; @@ -3484,6 +3506,7 @@ static const char __pyx_k_overriding_providers[] = "overriding_providers"; static const char __pyx_k_DependenciesContainer[] = "DependenciesContainer"; static const char __pyx_k_DynamicContainer_wire[] = "DynamicContainer.wire"; static const char __pyx_k_SingletonResetContext[] = "SingletonResetContext"; +static const char __pyx_k_independent_resources[] = "_independent_resources"; static const char __pyx_k_is_async_mode_enabled[] = "is_async_mode_enabled"; static const char __pyx_k_reset_last_overriding[] = "reset_last_overriding"; static const char __pyx_k_resolve_provider_name[] = "resolve_provider_name"; @@ -3502,7 +3525,6 @@ static const char __pyx_k_Pyx_CFunc_object____object[] = "__Pyx_CFunc_object____ static const char __pyx_k_has_undefined_dependencies[] = "\" has undefined dependencies: "; static const char __pyx_k_override_locals__decorator[] = "override.._decorator"; static const char __pyx_k_DynamicContainer___deepcopy[] = "DynamicContainer.__deepcopy__"; -static const char __pyx_k_no_initialized_dependencies[] = "_no_initialized_dependencies"; static const char __pyx_k_DynamicContainer_from_schema[] = "DynamicContainer.from_schema"; static const char __pyx_k_DynamicContainer_parent_name[] = "DynamicContainer.parent_name"; static const char __pyx_k_SingletonResetContext___exit[] = "SingletonResetContext.__exit__"; @@ -3527,7 +3549,6 @@ static const char __pyx_k_DeclarativeContainer_reset_last[] = "DeclarativeContai static const char __pyx_k_DynamicContainer_init_resources[] = "DynamicContainer.init_resources"; static const char __pyx_k_DynamicContainer_reset_override[] = "DynamicContainer.reset_override"; static const char __pyx_k_copy_locals__get_providers_memo[] = "copy.._get_providers_memo"; -static const char __pyx_k_without_initialized_dependencie[] = "_without_initialized_dependencies"; static const char __pyx_k_Can_not_resolve_name_for_provide[] = "Can not resolve name for provider \""; static const char __pyx_k_Container_0_could_not_be_overrid[] = "Container {0} could not be overridden with itself"; static const char __pyx_k_Container_can_have_only_one_Self[] = "Container can have only one \"Self\" provider"; @@ -3545,7 +3566,7 @@ static const char __pyx_k_DynamicContainer_override_provid[] = "DynamicContainer static const char __pyx_k_DynamicContainer_reset_last_over[] = "DynamicContainer.reset_last_overriding"; static const char __pyx_k_DynamicContainer_reset_singleton[] = "DynamicContainer.reset_singletons"; static const char __pyx_k_DynamicContainer_resolve_provide[] = "DynamicContainer.resolve_provider_name"; -static const char __pyx_k_DynamicContainer_shutdown_resour[] = "DynamicContainer.shutdown_resources.._any_initialized..genexpr"; +static const char __pyx_k_DynamicContainer_shutdown_resour[] = "DynamicContainer.shutdown_resources.._independent_resources"; static const char __pyx_k_Dynamic_inversion_of_control_con[] = "Dynamic inversion of control container.\n\n .. code-block:: python\n\n services = DynamicContainer()\n services.auth = providers.Factory(AuthService)\n services.users = providers.Factory(UsersService,\n auth_service=services.auth)\n\n .. py:attribute:: providers\n\n Read-only dictionary of all providers.\n\n :type: dict[str, :py:class:`dependency_injector.providers.Provider`]\n\n .. py:attribute:: overridden\n\n Tuple of overriding containers.\n\n :type: tuple[:py:class:`DynamicContainer`]\n\n .. py:attribute:: provider_type\n\n Type of providers that could be placed in container.\n\n :type: type\n "; static const char __pyx_k_Pyx_CFunc_void____object____ob_2[] = "__Pyx_CFunc_void____object____object___to_py..wrap"; static const char __pyx_k_Pyx_CFunc_void____object____ob_3[] = "__Pyx_CFunc_void____object____object____object___to_py..wrap"; @@ -3556,14 +3577,12 @@ static const char __pyx_k_apply_container_providers_overri[] = "apply_container_ static const char __pyx_k_src_dependency_injector_containe[] = "src/dependency_injector/containers.pyx"; static const char __pyx_k_Container_0_could_not_be_overrid_2[] = "Container {0} could not be overridden with itself or its subclasses"; static const char __pyx_k_Declarative_inversion_of_control_2[] = "Declarative inversion of control container.\n\n .. code-block:: python\n\n class Services(DeclarativeContainer):\n auth = providers.Factory(AuthService)\n users = providers.Factory(UsersService,\n auth_service=auth)\n "; -static const char __pyx_k_DynamicContainer_shutdown_resour_2[] = "DynamicContainer.shutdown_resources.._any_in_async_mode..genexpr"; +static const char __pyx_k_DynamicContainer_shutdown_resour_2[] = "DynamicContainer.shutdown_resources.._async_ordered_shutdown..genexpr"; static const char __pyx_k_DynamicContainer_shutdown_resour_3[] = "DynamicContainer.shutdown_resources.._async_ordered_shutdown"; -static const char __pyx_k_DynamicContainer_shutdown_resour_4[] = "DynamicContainer.shutdown_resources.._no_initialized_dependencies"; -static const char __pyx_k_DynamicContainer_shutdown_resour_5[] = "DynamicContainer.shutdown_resources.._without_initialized_dependencies"; -static const char __pyx_k_DynamicContainer_shutdown_resour_6[] = "DynamicContainer.shutdown_resources.._any_initialized"; -static const char __pyx_k_DynamicContainer_shutdown_resour_7[] = "DynamicContainer.shutdown_resources.._any_in_async_mode"; -static const char __pyx_k_DynamicContainer_shutdown_resour_8[] = "DynamicContainer.shutdown_resources.._sync_ordered_shutdown"; -static const char __pyx_k_DynamicContainer_shutdown_resour_9[] = "DynamicContainer.shutdown_resources"; +static const char __pyx_k_DynamicContainer_shutdown_resour_4[] = "DynamicContainer.shutdown_resources.._sync_ordered_shutdown..genexpr"; +static const char __pyx_k_DynamicContainer_shutdown_resour_5[] = "DynamicContainer.shutdown_resources..genexpr"; +static const char __pyx_k_DynamicContainer_shutdown_resour_6[] = "DynamicContainer.shutdown_resources.._sync_ordered_shutdown"; +static const char __pyx_k_DynamicContainer_shutdown_resour_7[] = "DynamicContainer.shutdown_resources"; static PyObject *__pyx_kp_s_0_can_contain_only_1_instances; static PyObject *__pyx_kp_s_Abstract_container; static PyObject *__pyx_n_s_AttributeError; @@ -3624,8 +3643,6 @@ static PyObject *__pyx_n_s_DynamicContainer_shutdown_resour_4; static PyObject *__pyx_n_s_DynamicContainer_shutdown_resour_5; static PyObject *__pyx_n_s_DynamicContainer_shutdown_resour_6; static PyObject *__pyx_n_s_DynamicContainer_shutdown_resour_7; -static PyObject *__pyx_n_s_DynamicContainer_shutdown_resour_8; -static PyObject *__pyx_n_s_DynamicContainer_shutdown_resour_9; static PyObject *__pyx_n_s_DynamicContainer_traverse; static PyObject *__pyx_n_s_DynamicContainer_unwire; static PyObject *__pyx_n_s_DynamicContainer_wire; @@ -3652,17 +3669,15 @@ static PyObject *__pyx_n_s_SingletonResetContext___init; static PyObject *__pyx_kp_s_Unable_to_load_yaml_schema_PyYAM; static PyObject *__pyx_kp_s_Unable_to_resolve_resources_shut; static PyObject *__pyx_kp_s_Wiring_requires_Python_3_6_or_ab; -static PyObject *__pyx_n_s__124; -static PyObject *__pyx_kp_u__17; -static PyObject *__pyx_kp_s__18; -static PyObject *__pyx_n_s__27; -static PyObject *__pyx_n_s__36; +static PyObject *__pyx_kp_u__11; +static PyObject *__pyx_n_s__118; +static PyObject *__pyx_kp_s__12; +static PyObject *__pyx_n_s__21; +static PyObject *__pyx_n_s__30; static PyObject *__pyx_n_s_add_done_callback; static PyObject *__pyx_n_s_add_metaclass; static PyObject *__pyx_n_s_all_providers; static PyObject *__pyx_n_s_alt_names; -static PyObject *__pyx_n_s_any_in_async_mode; -static PyObject *__pyx_n_s_any_initialized; static PyObject *__pyx_n_s_apply_container_providers_overri; static PyObject *__pyx_n_s_apply_overridings; static PyObject *__pyx_n_s_args; @@ -3715,7 +3730,6 @@ static PyObject *__pyx_n_s_extend; static PyObject *__pyx_n_s_fetch_self; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_filepath; -static PyObject *__pyx_n_s_filter; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_from_json_schema; static PyObject *__pyx_n_s_from_providers; @@ -3733,6 +3747,7 @@ static PyObject *__pyx_n_s_get_providers_memo; static PyObject *__pyx_kp_u_has_undefined_dependencies; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_independent_resources; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_inherited_providers; static PyObject *__pyx_n_s_init; @@ -3762,9 +3777,9 @@ static PyObject *__pyx_n_s_modules; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_new; -static PyObject *__pyx_n_s_no_initialized_dependencies; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_other_resource; static PyObject *__pyx_n_s_overridden; static PyObject *__pyx_n_s_override; static PyObject *__pyx_n_s_override_locals__decorator; @@ -3837,7 +3852,6 @@ static PyObject *__pyx_n_s_wire; static PyObject *__pyx_n_s_wired_to_modules; static PyObject *__pyx_n_s_wired_to_packages; static PyObject *__pyx_n_s_wiring; -static PyObject *__pyx_n_s_without_initialized_dependencie; static PyObject *__pyx_n_s_wrap; static PyObject *__pyx_n_s_yaml; static PyObject *__pyx_n_s_zip; @@ -3858,14 +3872,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_25wire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_modules, PyObject *__pyx_v_packages); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_27unwire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_29init_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__no_initialized_dependencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resource); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2_without_initialized_dependencies(PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_16_any_initialized_genexpr(PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_any_initialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_18_any_in_async_mode_genexpr(PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_any_in_async_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_11_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__independent_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_23_async_ordered_shutdown_genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_22_sync_ordered_shutdown_genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /* proto */ +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_31shutdown_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_33apply_container_providers_overridings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_35reset_singletons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ @@ -3904,14 +3916,15 @@ static PyObject *__pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_void____object____obje static PyObject *__pyx_pf_11cfunc_dot_to_py_46__Pyx_CFunc_object____object____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_future_result, PyObject *__pyx_v_future); /* proto */ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct__traverse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_traverse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_override(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_copy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_traverse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_override(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_10_copy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_void____object____object____object____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_void____object____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_void____object____object____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3928,125 +3941,119 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__37; -static PyObject *__pyx_tuple__11; +static PyObject *__pyx_slice__31; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__28; -static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__32; -static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__39; -static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__54; -static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__64; -static PyObject *__pyx_tuple__66; -static PyObject *__pyx_tuple__68; -static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__81; -static PyObject *__pyx_tuple__83; -static PyObject *__pyx_tuple__85; -static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__88; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__92; static PyObject *__pyx_tuple__94; static PyObject *__pyx_tuple__96; static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_tuple__100; static PyObject *__pyx_tuple__102; static PyObject *__pyx_tuple__104; -static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__106; static PyObject *__pyx_tuple__108; static PyObject *__pyx_tuple__110; static PyObject *__pyx_tuple__112; static PyObject *__pyx_tuple__114; static PyObject *__pyx_tuple__116; -static PyObject *__pyx_tuple__118; -static PyObject *__pyx_tuple__120; -static PyObject *__pyx_tuple__122; -static PyObject *__pyx_tuple__125; -static PyObject *__pyx_tuple__127; -static PyObject *__pyx_tuple__129; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__121; +static PyObject *__pyx_tuple__123; static PyObject *__pyx_codeobj__10; -static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; -static PyObject *__pyx_codeobj__22; -static PyObject *__pyx_codeobj__24; -static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; -static PyObject *__pyx_codeobj__31; -static PyObject *__pyx_codeobj__33; -static PyObject *__pyx_codeobj__35; -static PyObject *__pyx_codeobj__40; -static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__45; static PyObject *__pyx_codeobj__47; -static PyObject *__pyx_codeobj__49; static PyObject *__pyx_codeobj__51; static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__57; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__61; static PyObject *__pyx_codeobj__63; -static PyObject *__pyx_codeobj__65; -static PyObject *__pyx_codeobj__67; -static PyObject *__pyx_codeobj__69; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; static PyObject *__pyx_codeobj__72; static PyObject *__pyx_codeobj__74; static PyObject *__pyx_codeobj__76; static PyObject *__pyx_codeobj__78; static PyObject *__pyx_codeobj__80; -static PyObject *__pyx_codeobj__82; -static PyObject *__pyx_codeobj__84; -static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; static PyObject *__pyx_codeobj__89; static PyObject *__pyx_codeobj__91; static PyObject *__pyx_codeobj__93; static PyObject *__pyx_codeobj__95; static PyObject *__pyx_codeobj__97; -static PyObject *__pyx_codeobj__99; static PyObject *__pyx_codeobj__101; static PyObject *__pyx_codeobj__103; +static PyObject *__pyx_codeobj__105; static PyObject *__pyx_codeobj__107; static PyObject *__pyx_codeobj__109; static PyObject *__pyx_codeobj__111; static PyObject *__pyx_codeobj__113; static PyObject *__pyx_codeobj__115; static PyObject *__pyx_codeobj__117; -static PyObject *__pyx_codeobj__119; -static PyObject *__pyx_codeobj__121; -static PyObject *__pyx_codeobj__123; -static PyObject *__pyx_codeobj__126; -static PyObject *__pyx_codeobj__128; -static PyObject *__pyx_codeobj__130; +static PyObject *__pyx_codeobj__120; +static PyObject *__pyx_codeobj__122; +static PyObject *__pyx_codeobj__124; /* Late includes */ /* "dependency_injector/containers.pyx":25 @@ -8511,7 +8518,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * * def shutdown_resources(self): # <<<<<<<<<<<<<< * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): + * def _independent_resources(resources): */ /* Python wrapper */ @@ -8528,86 +8535,131 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "dependency_injector/containers.pyx":293 * def shutdown_resources(self): * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): # <<<<<<<<<<<<<< - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: + * def _independent_resources(resources): # <<<<<<<<<<<<<< + * for resource in resources: + * for other_resource in resources: */ /* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_no_initialized_dependencies(PyObject *__pyx_self, PyObject *__pyx_v_resource); /*proto*/ -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_no_initialized_dependencies = {"_no_initialized_dependencies", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_no_initialized_dependencies, METH_O, 0}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_no_initialized_dependencies(PyObject *__pyx_self, PyObject *__pyx_v_resource) { +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_independent_resources(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ +static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_independent_resources = {"_independent_resources", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_independent_resources, METH_O, 0}; +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_independent_resources(PyObject *__pyx_self, PyObject *__pyx_v_resources) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_no_initialized_dependencies (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__no_initialized_dependencies(__pyx_self, ((PyObject *)__pyx_v_resource)); + __Pyx_RefNannySetupContext("_independent_resources (wrapper)", 0); + __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__independent_resources(__pyx_self, ((PyObject *)__pyx_v_resources)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__no_initialized_dependencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resource) { - PyObject *__pyx_v_related = NULL; +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__independent_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resources) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_no_initialized_dependencies", 0); + __Pyx_RefNannySetupContext("_independent_resources", 0); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 293, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_resources = __pyx_v_resources; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resources); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resources); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_independent_resources, __pyx_n_s_DynamicContainer_shutdown_resour, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._independent_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *)__pyx_generator->closure); + 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; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_independent_resources", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L11_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 293, __pyx_L1_error) /* "dependency_injector/containers.pyx":294 * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): - * for related in resource.related: # <<<<<<<<<<<<<< - * if isinstance(related, providers.Resource) and related.initialized: - * return False + * def _independent_resources(resources): + * for resource in resources: # <<<<<<<<<<<<<< + * for other_resource in resources: + * if not other_resource.initialized: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_resource, __pyx_n_s_related); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_resources)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_resources)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_v_resources; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __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, 294, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + 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_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) + __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, 294, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) + __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, 294, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif } } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -8615,240 +8667,277 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_v_related, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resource); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "dependency_injector/containers.pyx":295 - * def _no_initialized_dependencies(resource): - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: # <<<<<<<<<<<<<< - * return False - * return True + * def _independent_resources(resources): + * for resource in resources: + * for other_resource in resources: # <<<<<<<<<<<<<< + * if not other_resource.initialized: + * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Resource); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = PyObject_IsInstance(__pyx_v_related, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = (__pyx_t_7 != 0); - if (__pyx_t_8) { + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_resources)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_resources)) { + __pyx_t_4 = __pyx_cur_scope->__pyx_v_resources; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_5 = __pyx_t_8; - goto __pyx_L6_bool_binop_done; + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_resources); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_related, __pyx_n_s_initialized); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __pyx_t_8; - __pyx_L6_bool_binop_done:; - if (__pyx_t_5) { + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 295, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 295, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 295, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_other_resource); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_other_resource, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; /* "dependency_injector/containers.pyx":296 - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: - * return False # <<<<<<<<<<<<<< - * return True - * + * for resource in resources: + * for other_resource in resources: + * if not other_resource.initialized: # <<<<<<<<<<<<<< + * continue + * if resource in other_resource.related: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_other_resource, __pyx_n_s_initialized); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = ((!__pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "dependency_injector/containers.pyx":297 + * for other_resource in resources: + * if not other_resource.initialized: + * continue # <<<<<<<<<<<<<< + * if resource in other_resource.related: + * break + */ + goto __pyx_L6_continue; + + /* "dependency_injector/containers.pyx":296 + * for resource in resources: + * for other_resource in resources: + * if not other_resource.initialized: # <<<<<<<<<<<<<< + * continue + * if resource in other_resource.related: + */ + } + + /* "dependency_injector/containers.pyx":298 + * if not other_resource.initialized: + * continue + * if resource in other_resource.related: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_other_resource, __pyx_n_s_related); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_resource, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "dependency_injector/containers.pyx":299 + * continue + * if resource in other_resource.related: + * break # <<<<<<<<<<<<<< + * else: + * yield resource + */ + goto __pyx_L7_break; + + /* "dependency_injector/containers.pyx":298 + * if not other_resource.initialized: + * continue + * if resource in other_resource.related: # <<<<<<<<<<<<<< + * break + * else: + */ + } /* "dependency_injector/containers.pyx":295 - * def _no_initialized_dependencies(resource): - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: # <<<<<<<<<<<<<< - * return False - * return True + * def _independent_resources(resources): + * for resource in resources: + * for other_resource in resources: # <<<<<<<<<<<<<< + * if not other_resource.initialized: + * continue */ + __pyx_L6_continue:; } + /*else*/ { + + /* "dependency_injector/containers.pyx":301 + * break + * else: + * yield resource # <<<<<<<<<<<<<< + * + * async def _async_ordered_shutdown(resources): + */ + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resource); + __pyx_r = __pyx_cur_scope->__pyx_v_resource; + __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_4); + __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_6; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L11_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __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_4 = __pyx_cur_scope->__pyx_t_3; + __pyx_cur_scope->__pyx_t_3 = 0; + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_5 = __pyx_cur_scope->__pyx_t_4; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_5; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 301, __pyx_L1_error) + } + + /* "dependency_injector/containers.pyx":295 + * def _independent_resources(resources): + * for resource in resources: + * for other_resource in resources: # <<<<<<<<<<<<<< + * if not other_resource.initialized: + * continue + */ + __pyx_L7_break:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "dependency_injector/containers.pyx":294 * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): - * for related in resource.related: # <<<<<<<<<<<<<< - * if isinstance(related, providers.Resource) and related.initialized: - * return False + * def _independent_resources(resources): + * for resource in resources: # <<<<<<<<<<<<<< + * for other_resource in resources: + * if not other_resource.initialized: */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "dependency_injector/containers.pyx":297 - * if isinstance(related, providers.Resource) and related.initialized: - * return False - * return True # <<<<<<<<<<<<<< - * - * def _without_initialized_dependencies(resources): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "dependency_injector/containers.pyx":293 * def shutdown_resources(self): * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): # <<<<<<<<<<<<<< - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: + * def _independent_resources(resources): # <<<<<<<<<<<<<< + * for resource in resources: + * for other_resource in resources: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._no_initialized_dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_related); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/containers.pyx":299 - * return True - * - * def _without_initialized_dependencies(resources): # <<<<<<<<<<<<<< - * return list(filter(_no_initialized_dependencies, resources)) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_without_initialized_dependencies(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_without_initialized_dependencies = {"_without_initialized_dependencies", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_without_initialized_dependencies, METH_O, 0}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_without_initialized_dependencies(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_without_initialized_dependencies (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2_without_initialized_dependencies(__pyx_self, ((PyObject *)__pyx_v_resources)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2_without_initialized_dependencies(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_cur_scope; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_outer_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_without_initialized_dependencies", 0); - __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - - /* "dependency_injector/containers.pyx":300 - * - * def _without_initialized_dependencies(resources): - * return list(filter(_no_initialized_dependencies, resources)) # <<<<<<<<<<<<<< - * - * def _any_initialized(resources): - */ - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v__no_initialized_dependencies)) { __Pyx_RaiseClosureNameError("_no_initialized_dependencies"); __PYX_ERR(0, 300, __pyx_L1_error) } - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v__no_initialized_dependencies); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__no_initialized_dependencies); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v__no_initialized_dependencies); - __Pyx_INCREF(__pyx_v_resources); - __Pyx_GIVEREF(__pyx_v_resources); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_resources); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; - - /* "dependency_injector/containers.pyx":299 - * return True - * - * def _without_initialized_dependencies(resources): # <<<<<<<<<<<<<< - * return list(filter(_no_initialized_dependencies, resources)) - * - */ - - /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._without_initialized_dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_independent_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } - -/* "dependency_injector/containers.pyx":302 - * return list(filter(_no_initialized_dependencies, resources)) - * - * def _any_initialized(resources): # <<<<<<<<<<<<<< - * return any(resource.initialized for resource in resources) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5_any_initialized(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5_any_initialized = {"_any_initialized", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5_any_initialized, METH_O, 0}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5_any_initialized(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_any_initialized (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_any_initialized(__pyx_self, ((PyObject *)__pyx_v_resources)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_16_any_initialized_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "dependency_injector/containers.pyx":303 + * yield resource * - * def _any_initialized(resources): - * return any(resource.initialized for resource in resources) # <<<<<<<<<<<<<< - * - * def _any_in_async_mode(resources): + * async def _async_ordered_shutdown(resources): # <<<<<<<<<<<<<< + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_16_any_initialized_genexpr(PyObject *__pyx_self) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *__pyx_cur_scope; +/* Python wrapper */ +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ +static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_async_ordered_shutdown = {"_async_ordered_shutdown", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_async_ordered_shutdown, METH_O, 0}; +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_async_ordered_shutdown (wrapper)", 0); + __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_async_ordered_shutdown(__pyx_self, ((PyObject *)__pyx_v_resources)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_23_async_ordered_shutdown_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "dependency_injector/containers.pyx":304 + * + * async def _async_ordered_shutdown(resources): + * while any(resource.initialized for resource in resources): # <<<<<<<<<<<<<< + * resources_to_shutdown = list(_independent_resources(resources)) + * if not resources_to_shutdown: + */ + +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_23_async_ordered_shutdown_genexpr(PyObject *__pyx_self) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3_genexpr(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4_genexpr(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 303, __pyx_L1_error) + __PYX_ERR(0, 304, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *) __pyx_self; __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_16DynamicContainer_18shutdown_resources_16_any_initialized_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DynamicContainer_shutdown_resour, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_23_async_ordered_shutdown_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DynamicContainer_shutdown_resour_2, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8856,7 +8945,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._any_initialized.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._async_ordered_shutdown.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); @@ -8864,9 +8953,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_16_any_initialized_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_23_async_ordered_shutdown_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -8885,32 +8974,32 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 303, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { __Pyx_RaiseClosureNameError("resources"); __PYX_ERR(0, 303, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 304, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { __Pyx_RaiseClosureNameError("resources"); __PYX_ERR(0, 304, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources; __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_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __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, 303, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) } 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, 303, __pyx_L1_error) + __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, 304, __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, 303, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __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, 303, __pyx_L1_error) + __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, 304, __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, 303, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -8920,7 +9009,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 303, __pyx_L1_error) + else __PYX_ERR(0, 304, __pyx_L1_error) } break; } @@ -8930,9 +9019,9 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_initialized); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_initialized); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -8969,369 +9058,27 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":302 - * return list(filter(_no_initialized_dependencies, resources)) - * - * def _any_initialized(resources): # <<<<<<<<<<<<<< - * return any(resource.initialized for resource in resources) - * - */ - -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_any_initialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resources) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_any_initialized", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 302, __pyx_L1_error) - } else { - __Pyx_GOTREF(__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_resources = __pyx_v_resources; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resources); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resources); - - /* "dependency_injector/containers.pyx":303 - * - * def _any_initialized(resources): - * return any(resource.initialized for resource in resources) # <<<<<<<<<<<<<< - * - * def _any_in_async_mode(resources): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_16_any_initialized_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "dependency_injector/containers.pyx":302 - * return list(filter(_no_initialized_dependencies, resources)) - * - * def _any_initialized(resources): # <<<<<<<<<<<<<< - * return any(resource.initialized for resource in resources) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._any_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/containers.pyx":305 - * return any(resource.initialized for resource in resources) - * - * def _any_in_async_mode(resources): # <<<<<<<<<<<<<< - * return any(resource.is_async_mode_enabled() for resource in resources) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_any_in_async_mode(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_any_in_async_mode = {"_any_in_async_mode", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_any_in_async_mode, METH_O, 0}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_any_in_async_mode(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_any_in_async_mode (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_any_in_async_mode(__pyx_self, ((PyObject *)__pyx_v_resources)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_18_any_in_async_mode_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "dependency_injector/containers.pyx":306 - * - * def _any_in_async_mode(resources): - * return any(resource.is_async_mode_enabled() for resource in resources) # <<<<<<<<<<<<<< - * - * async def _async_ordered_shutdown(resources): - */ - -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_18_any_in_async_mode_genexpr(PyObject *__pyx_self) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5_genexpr(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 306, __pyx_L1_error) - } else { - __Pyx_GOTREF(__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *) __pyx_self; - __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_16DynamicContainer_18shutdown_resources_18_any_in_async_mode_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DynamicContainer_shutdown_resour_2, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._any_in_async_mode.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_18_any_in_async_mode_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); - 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_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 306, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { __Pyx_RaiseClosureNameError("resources"); __PYX_ERR(0, 306, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources; __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_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __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, 306, __pyx_L1_error) - } - 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, 306, __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, 306, __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, 306, __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, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 306, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resource); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_is_async_mode_enabled); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - } - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/containers.pyx":305 - * return any(resource.initialized for resource in resources) - * - * def _any_in_async_mode(resources): # <<<<<<<<<<<<<< - * return any(resource.is_async_mode_enabled() for resource in resources) - * - */ - -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_any_in_async_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resources) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_any_in_async_mode", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 305, __pyx_L1_error) - } else { - __Pyx_GOTREF(__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_resources = __pyx_v_resources; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resources); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resources); - - /* "dependency_injector/containers.pyx":306 - * - * def _any_in_async_mode(resources): - * return any(resource.is_async_mode_enabled() for resource in resources) # <<<<<<<<<<<<<< - * - * async def _async_ordered_shutdown(resources): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_18_any_in_async_mode_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "dependency_injector/containers.pyx":305 - * return any(resource.initialized for resource in resources) - * - * def _any_in_async_mode(resources): # <<<<<<<<<<<<<< - * return any(resource.is_async_mode_enabled() for resource in resources) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._any_in_async_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "dependency_injector/containers.pyx":308 - * return any(resource.is_async_mode_enabled() for resource in resources) +/* "dependency_injector/containers.pyx":303 + * yield resource * * async def _async_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ -/* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_9_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_9_async_ordered_shutdown = {"_async_ordered_shutdown", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_9_async_ordered_shutdown, METH_O, 0}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_9_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_async_ordered_shutdown (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8_async_ordered_shutdown(__pyx_self, ((PyObject *)__pyx_v_resources)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *__pyx_cur_scope; +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_async_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_async_ordered_shutdown", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 308, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -9342,7 +9089,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resources); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resources); { - __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_10generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_async_ordered_shutdown, __pyx_n_s_DynamicContainer_shutdown_resour_3, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_async_ordered_shutdown, __pyx_n_s_DynamicContainer_shutdown_resour_3, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9358,19 +9105,18 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *)__pyx_generator->closure); + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_4; + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9384,185 +9130,163 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 303, __pyx_L1_error) - /* "dependency_injector/containers.pyx":309 + /* "dependency_injector/containers.pyx":304 * * async def _async_ordered_shutdown(resources): - * while _any_initialized(resources): # <<<<<<<<<<<<<< - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): # <<<<<<<<<<<<<< + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: */ while (1) { - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__any_initialized)) { __Pyx_RaiseClosureNameError("_any_initialized"); __PYX_ERR(0, 309, __pyx_L1_error) } - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_any_initialized(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__any_initialized, __pyx_cur_scope->__pyx_v_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_23_async_ordered_shutdown_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __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, 309, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_2) break; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) break; - /* "dependency_injector/containers.pyx":310 + /* "dependency_injector/containers.pyx":305 * async def _async_ordered_shutdown(resources): - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) # <<<<<<<<<<<<<< + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) # <<<<<<<<<<<<<< * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__without_initialized_dependencies)) { __Pyx_RaiseClosureNameError("_without_initialized_dependencies"); __PYX_ERR(0, 310, __pyx_L1_error) } - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2_without_initialized_dependencies(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__without_initialized_dependencies, __pyx_cur_scope->__pyx_v_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __pyx_cur_scope->__pyx_v_resources; + __Pyx_INCREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__independent_resources)) { __Pyx_RaiseClosureNameError("_independent_resources"); __PYX_ERR(0, 305, __pyx_L1_error) } + __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__independent_resources(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__independent_resources, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resources_to_shutdown); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resources_to_shutdown, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resources_to_shutdown, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":311 - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":306 + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: # <<<<<<<<<<<<<< * raise RuntimeError('Unable to resolve resources shutdown order') * futures = [] */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_resources_to_shutdown); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 311, __pyx_L1_error) - __pyx_t_3 = ((!__pyx_t_2) != 0); - if (unlikely(__pyx_t_3)) { + __pyx_t_3 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_resources_to_shutdown) != 0); + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (unlikely(__pyx_t_4)) { - /* "dependency_injector/containers.pyx":312 - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":307 + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') # <<<<<<<<<<<<<< * futures = [] * for resource in resources_to_shutdown: */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 307, __pyx_L1_error) - /* "dependency_injector/containers.pyx":311 - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":306 + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: # <<<<<<<<<<<<<< * raise RuntimeError('Unable to resolve resources shutdown order') * futures = [] */ } - /* "dependency_injector/containers.pyx":313 + /* "dependency_injector/containers.pyx":308 * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') * futures = [] # <<<<<<<<<<<<<< * for resource in resources_to_shutdown: * result = resource.shutdown() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_futures); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_futures, ((PyObject*)__pyx_t_1)); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_futures, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":314 + /* "dependency_injector/containers.pyx":309 * raise RuntimeError('Unable to resolve resources shutdown order') * futures = [] * for resource in resources_to_shutdown: # <<<<<<<<<<<<<< * result = resource.shutdown() * if __is_future_or_coroutine(result): */ - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_resources_to_shutdown)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_resources_to_shutdown)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_v_resources_to_shutdown; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_resources_to_shutdown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) - } + __pyx_t_2 = __pyx_cur_scope->__pyx_v_resources_to_shutdown; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 314, __pyx_L1_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 314, __pyx_L1_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } - } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_6)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 314, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } + if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 309, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resource); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":315 + /* "dependency_injector/containers.pyx":310 * futures = [] * for resource in resources_to_shutdown: * result = resource.shutdown() # <<<<<<<<<<<<<< * if __is_future_or_coroutine(result): * futures.append(result) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_result); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":316 + /* "dependency_injector/containers.pyx":311 * for resource in resources_to_shutdown: * result = resource.shutdown() * if __is_future_or_coroutine(result): # <<<<<<<<<<<<<< * futures.append(result) * await asyncio.gather(*futures) */ - __pyx_t_3 = (__pyx_f_19dependency_injector_9providers___is_future_or_coroutine(__pyx_cur_scope->__pyx_v_result) != 0); - if (__pyx_t_3) { + __pyx_t_4 = (__pyx_f_19dependency_injector_9providers___is_future_or_coroutine(__pyx_cur_scope->__pyx_v_result) != 0); + if (__pyx_t_4) { - /* "dependency_injector/containers.pyx":317 + /* "dependency_injector/containers.pyx":312 * result = resource.shutdown() * if __is_future_or_coroutine(result): * futures.append(result) # <<<<<<<<<<<<<< * await asyncio.gather(*futures) * */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_futures, __pyx_cur_scope->__pyx_v_result); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_futures, __pyx_cur_scope->__pyx_v_result); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 312, __pyx_L1_error) - /* "dependency_injector/containers.pyx":316 + /* "dependency_injector/containers.pyx":311 * for resource in resources_to_shutdown: * result = resource.shutdown() * if __is_future_or_coroutine(result): # <<<<<<<<<<<<<< @@ -9571,7 +9295,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":314 + /* "dependency_injector/containers.pyx":309 * raise RuntimeError('Unable to resolve resources shutdown order') * futures = [] * for resource in resources_to_shutdown: # <<<<<<<<<<<<<< @@ -9579,28 +9303,28 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ * if __is_future_or_coroutine(result): */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":318 + /* "dependency_injector/containers.pyx":313 * if __is_future_or_coroutine(result): * futures.append(result) * await asyncio.gather(*futures) # <<<<<<<<<<<<<< * * def _sync_ordered_shutdown(resources): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_gather); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_gather); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_futures); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_futures); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); @@ -9610,23 +9334,23 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L10_resume_from_await:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 313, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 318, __pyx_L1_error) + else __PYX_ERR(0, 313, __pyx_L1_error) } } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dependency_injector/containers.pyx":308 - * return any(resource.is_async_mode_enabled() for resource in resources) + /* "dependency_injector/containers.pyx":303 + * yield resource * * async def _async_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ /* function exit code */ @@ -9634,9 +9358,9 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("_async_ordered_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; @@ -9649,187 +9373,333 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":320 +/* "dependency_injector/containers.pyx":315 * await asyncio.gather(*futures) * * def _sync_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ /* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_12_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_12_sync_ordered_shutdown = {"_sync_ordered_shutdown", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_12_sync_ordered_shutdown, METH_O, 0}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_12_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources); /*proto*/ +static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_sync_ordered_shutdown = {"_sync_ordered_shutdown", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_sync_ordered_shutdown, METH_O, 0}; +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_sync_ordered_shutdown (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_11_sync_ordered_shutdown(__pyx_self, ((PyObject *)__pyx_v_resources)); + __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_sync_ordered_shutdown(__pyx_self, ((PyObject *)__pyx_v_resources)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_22_sync_ordered_shutdown_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_11_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_cur_scope; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_outer_scope; +/* "dependency_injector/containers.pyx":316 + * + * def _sync_ordered_shutdown(resources): + * while any(resource.initialized for resource in resources): # <<<<<<<<<<<<<< + * resources_to_shutdown = list(_independent_resources(resources)) + * if not resources_to_shutdown: + */ + +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_22_sync_ordered_shutdown_genexpr(PyObject *__pyx_self) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6_genexpr(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 316, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *) __pyx_self; + __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_16DynamicContainer_18shutdown_resources_22_sync_ordered_shutdown_2generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DynamicContainer_shutdown_resour_4, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._sync_ordered_shutdown.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_22_sync_ordered_shutdown_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *)__pyx_generator->closure); + 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; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { __Pyx_RaiseClosureNameError("resources"); __PYX_ERR(0, 316, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources; __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_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __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, 316, __pyx_L1_error) + } + 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, 316, __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, 316, __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, 316, __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, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 316, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resource); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_initialized); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "dependency_injector/containers.pyx":315 + * await asyncio.gather(*futures) + * + * def _sync_ordered_shutdown(resources): # <<<<<<<<<<<<<< + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) + */ + +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_sync_ordered_shutdown(PyObject *__pyx_self, PyObject *__pyx_v_resources) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *__pyx_cur_scope; PyObject *__pyx_v_resources_to_shutdown = NULL; PyObject *__pyx_v_resource = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_4; + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_sync_ordered_shutdown", 0); - __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 315, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *) __Pyx_CyFunction_GetClosure(__pyx_self); + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + __pyx_cur_scope->__pyx_v_resources = __pyx_v_resources; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_resources); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_resources); - /* "dependency_injector/containers.pyx":321 + /* "dependency_injector/containers.pyx":316 * * def _sync_ordered_shutdown(resources): - * while _any_initialized(resources): # <<<<<<<<<<<<<< - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): # <<<<<<<<<<<<<< + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: */ while (1) { - if (unlikely(!__pyx_cur_scope->__pyx_v__any_initialized)) { __Pyx_RaiseClosureNameError("_any_initialized"); __PYX_ERR(0, 321, __pyx_L1_error) } - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_any_initialized(__pyx_cur_scope->__pyx_v__any_initialized, __pyx_v_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_22_sync_ordered_shutdown_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __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, 321, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_2) break; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) break; - /* "dependency_injector/containers.pyx":322 + /* "dependency_injector/containers.pyx":317 * def _sync_ordered_shutdown(resources): - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) # <<<<<<<<<<<<<< + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) # <<<<<<<<<<<<<< * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') */ - if (unlikely(!__pyx_cur_scope->__pyx_v__without_initialized_dependencies)) { __Pyx_RaiseClosureNameError("_without_initialized_dependencies"); __PYX_ERR(0, 322, __pyx_L1_error) } - __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_2_without_initialized_dependencies(__pyx_cur_scope->__pyx_v__without_initialized_dependencies, __pyx_v_resources); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_2 = __pyx_cur_scope->__pyx_v_resources; + __Pyx_INCREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__independent_resources)) { __Pyx_RaiseClosureNameError("_independent_resources"); __PYX_ERR(0, 317, __pyx_L1_error) } + __pyx_t_1 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources__independent_resources(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__independent_resources, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_resources_to_shutdown, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_resources_to_shutdown, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":323 - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":318 + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: # <<<<<<<<<<<<<< * raise RuntimeError('Unable to resolve resources shutdown order') * for resource in resources_to_shutdown: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_resources_to_shutdown); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) - __pyx_t_3 = ((!__pyx_t_2) != 0); - if (unlikely(__pyx_t_3)) { + __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_resources_to_shutdown) != 0); + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (unlikely(__pyx_t_4)) { - /* "dependency_injector/containers.pyx":324 - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":319 + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') # <<<<<<<<<<<<<< * for resource in resources_to_shutdown: * resource.shutdown() */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 319, __pyx_L1_error) - /* "dependency_injector/containers.pyx":323 - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":318 + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: # <<<<<<<<<<<<<< * raise RuntimeError('Unable to resolve resources shutdown order') * for resource in resources_to_shutdown: */ } - /* "dependency_injector/containers.pyx":325 + /* "dependency_injector/containers.pyx":320 * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') * for resource in resources_to_shutdown: # <<<<<<<<<<<<<< * resource.shutdown() * */ - if (likely(PyList_CheckExact(__pyx_v_resources_to_shutdown)) || PyTuple_CheckExact(__pyx_v_resources_to_shutdown)) { - __pyx_t_1 = __pyx_v_resources_to_shutdown; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_resources_to_shutdown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error) - } + __pyx_t_2 = __pyx_v_resources_to_shutdown; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } - } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_6)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 325, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_XDECREF_SET(__pyx_v_resource, __pyx_t_6); - __pyx_t_6 = 0; + if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 320, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_XDECREF_SET(__pyx_v_resource, __pyx_t_1); + __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":326 + /* "dependency_injector/containers.pyx":321 * raise RuntimeError('Unable to resolve resources shutdown order') * for resource in resources_to_shutdown: * resource.shutdown() # <<<<<<<<<<<<<< * * resources = list(self.traverse(types=[providers.Resource])) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_resource, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_resource, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":325 + /* "dependency_injector/containers.pyx":320 * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') * for resource in resources_to_shutdown: # <<<<<<<<<<<<<< @@ -9837,15 +9707,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "dependency_injector/containers.pyx":320 + /* "dependency_injector/containers.pyx":315 * await asyncio.gather(*futures) * * def _sync_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ /* function exit code */ @@ -9853,33 +9723,174 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources._sync_ordered_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_resources_to_shutdown); __Pyx_XDECREF(__pyx_v_resource); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_10generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "dependency_injector/containers.pyx":324 + * + * resources = list(self.traverse(types=[providers.Resource])) + * if any(resource.is_async_mode_enabled() for resource in resources): # <<<<<<<<<<<<<< + * return _async_ordered_shutdown(resources) + * else: + */ + +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8genexpr(PyObject *__pyx_self) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_genexpr(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 324, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *) __pyx_self; + __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_16DynamicContainer_18shutdown_resources_10generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DynamicContainer_shutdown_resour_5, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_10generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources)) { __Pyx_RaiseClosureNameError("resources"); __PYX_ERR(0, 324, __pyx_L1_error) } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 324, __pyx_L1_error) + } + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_resources; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 324, __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, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_resource); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_resource, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_resource, __pyx_n_s_is_async_mode_enabled); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} /* "dependency_injector/containers.pyx":291 * return asyncio.gather(*futures) * * def shutdown_resources(self): # <<<<<<<<<<<<<< * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): + * def _independent_resources(resources): */ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_31shutdown_resources(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *__pyx_cur_scope; - PyObject *__pyx_v__any_in_async_mode = 0; PyObject *__pyx_v__async_ordered_shutdown = 0; PyObject *__pyx_v__sync_ordered_shutdown = 0; - PyObject *__pyx_v_resources = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -9903,148 +9914,117 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /* "dependency_injector/containers.pyx":293 * def shutdown_resources(self): * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): # <<<<<<<<<<<<<< - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: + * def _independent_resources(resources): # <<<<<<<<<<<<<< + * for resource in resources: + * for other_resource in resources: */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_no_initialized_dependencies, 0, __pyx_n_s_DynamicContainer_shutdown_resour_4, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_1_independent_resources, 0, __pyx_n_s_DynamicContainer_shutdown_resour, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v__no_initialized_dependencies = __pyx_t_1; + __pyx_cur_scope->__pyx_v__independent_resources = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":299 - * return True - * - * def _without_initialized_dependencies(resources): # <<<<<<<<<<<<<< - * return list(filter(_no_initialized_dependencies, resources)) - * - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_without_initialized_dependencies, 0, __pyx_n_s_DynamicContainer_shutdown_resour_5, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v__without_initialized_dependencies = __pyx_t_1; - __pyx_t_1 = 0; - - /* "dependency_injector/containers.pyx":302 - * return list(filter(_no_initialized_dependencies, resources)) - * - * def _any_initialized(resources): # <<<<<<<<<<<<<< - * return any(resource.initialized for resource in resources) - * - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_5_any_initialized, 0, __pyx_n_s_DynamicContainer_shutdown_resour_6, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v__any_initialized = __pyx_t_1; - __pyx_t_1 = 0; - - /* "dependency_injector/containers.pyx":305 - * return any(resource.initialized for resource in resources) - * - * def _any_in_async_mode(resources): # <<<<<<<<<<<<<< - * return any(resource.is_async_mode_enabled() for resource in resources) - * - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_any_in_async_mode, 0, __pyx_n_s_DynamicContainer_shutdown_resour_7, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__any_in_async_mode = __pyx_t_1; - __pyx_t_1 = 0; - - /* "dependency_injector/containers.pyx":308 - * return any(resource.is_async_mode_enabled() for resource in resources) + /* "dependency_injector/containers.pyx":303 + * yield resource * * async def _async_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_9_async_ordered_shutdown, 0, __pyx_n_s_DynamicContainer_shutdown_resour_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_4_async_ordered_shutdown, 0, __pyx_n_s_DynamicContainer_shutdown_resour_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__async_ordered_shutdown = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":320 + /* "dependency_injector/containers.pyx":315 * await asyncio.gather(*futures) * * def _sync_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_12_sync_ordered_shutdown, 0, __pyx_n_s_DynamicContainer_shutdown_resour_8, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_7_sync_ordered_shutdown, 0, __pyx_n_s_DynamicContainer_shutdown_resour_6, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__sync_ordered_shutdown = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":328 + /* "dependency_injector/containers.pyx":323 * resource.shutdown() * * resources = list(self.traverse(types=[providers.Resource])) # <<<<<<<<<<<<<< - * if _any_in_async_mode(resources): + * if any(resource.is_async_mode_enabled() for resource in resources): * return _async_ordered_shutdown(resources) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Resource); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Resource); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_t_3) < 0) __PYX_ERR(0, 328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_t_3) < 0) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_resources = ((PyObject*)__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_resources = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":329 + /* "dependency_injector/containers.pyx":324 * * resources = list(self.traverse(types=[providers.Resource])) - * if _any_in_async_mode(resources): # <<<<<<<<<<<<<< + * if any(resource.is_async_mode_enabled() for resource in resources): # <<<<<<<<<<<<<< * return _async_ordered_shutdown(resources) * else: */ - __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_any_in_async_mode(__pyx_v__any_in_async_mode, __pyx_v_resources); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "dependency_injector/containers.pyx":330 + /* "dependency_injector/containers.pyx":325 * resources = list(self.traverse(types=[providers.Resource])) - * if _any_in_async_mode(resources): + * if any(resource.is_async_mode_enabled() for resource in resources): * return _async_ordered_shutdown(resources) # <<<<<<<<<<<<<< * else: * return _sync_ordered_shutdown(resources) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_8_async_ordered_shutdown(__pyx_v__async_ordered_shutdown, __pyx_v_resources); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_3 = __pyx_cur_scope->__pyx_v_resources; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_3_async_ordered_shutdown(__pyx_v__async_ordered_shutdown, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":329 + /* "dependency_injector/containers.pyx":324 * * resources = list(self.traverse(types=[providers.Resource])) - * if _any_in_async_mode(resources): # <<<<<<<<<<<<<< + * if any(resource.is_async_mode_enabled() for resource in resources): # <<<<<<<<<<<<<< * return _async_ordered_shutdown(resources) * else: */ } - /* "dependency_injector/containers.pyx":332 + /* "dependency_injector/containers.pyx":327 * return _async_ordered_shutdown(resources) * else: * return _sync_ordered_shutdown(resources) # <<<<<<<<<<<<<< @@ -10053,10 +10033,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_11_sync_ordered_shutdown(__pyx_v__sync_ordered_shutdown, __pyx_v_resources); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_2 = __pyx_cur_scope->__pyx_v_resources; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_18shutdown_resources_6_sync_ordered_shutdown(__pyx_v__sync_ordered_shutdown, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; } @@ -10065,7 +10048,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * * def shutdown_resources(self): # <<<<<<<<<<<<<< * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): + * def _independent_resources(resources): */ /* function exit code */ @@ -10077,17 +10060,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.shutdown_resources", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v__any_in_async_mode); __Pyx_XDECREF(__pyx_v__async_ordered_shutdown); __Pyx_XDECREF(__pyx_v__sync_ordered_shutdown); - __Pyx_XDECREF(__pyx_v_resources); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "dependency_injector/containers.pyx":334 +/* "dependency_injector/containers.pyx":329 * return _sync_ordered_shutdown(resources) * * def apply_container_providers_overridings(self): # <<<<<<<<<<<<<< @@ -10125,12 +10106,181 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply_container_providers_overridings", 0); - /* "dependency_injector/containers.pyx":336 + /* "dependency_injector/containers.pyx":331 * def apply_container_providers_overridings(self): * """Apply container providers' overridings.""" * for provider in self.traverse(types=[providers.Container]): # <<<<<<<<<<<<<< * provider.apply_overridings() * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_t_3) < 0) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 331, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_3); + __pyx_t_3 = 0; + + /* "dependency_injector/containers.pyx":332 + * """Apply container providers' overridings.""" + * for provider in self.traverse(types=[providers.Container]): + * provider.apply_overridings() # <<<<<<<<<<<<<< + * + * def reset_singletons(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_apply_overridings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "dependency_injector/containers.pyx":331 + * def apply_container_providers_overridings(self): + * """Apply container providers' overridings.""" + * for provider in self.traverse(types=[providers.Container]): # <<<<<<<<<<<<<< + * provider.apply_overridings() + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "dependency_injector/containers.pyx":329 + * return _sync_ordered_shutdown(resources) + * + * def apply_container_providers_overridings(self): # <<<<<<<<<<<<<< + * """Apply container providers' overridings.""" + * for provider in self.traverse(types=[providers.Container]): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.apply_container_providers_overridings", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_provider); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "dependency_injector/containers.pyx":334 + * provider.apply_overridings() + * + * def reset_singletons(self): # <<<<<<<<<<<<<< + * """Reset container singletons.""" + * for provider in self.traverse(types=[providers.BaseSingleton]): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_36reset_singletons(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_19dependency_injector_10containers_16DynamicContainer_35reset_singletons[] = "Reset container singletons."; +static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_36reset_singletons = {"reset_singletons", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_36reset_singletons, METH_O, __pyx_doc_19dependency_injector_10containers_16DynamicContainer_35reset_singletons}; +static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_36reset_singletons(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_singletons (wrapper)", 0); + __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_35reset_singletons(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_35reset_singletons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_provider = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset_singletons", 0); + + /* "dependency_injector/containers.pyx":336 + * def reset_singletons(self): + * """Reset container singletons.""" + * for provider in self.traverse(types=[providers.BaseSingleton]): # <<<<<<<<<<<<<< + * provider.reset() + * return SingletonResetContext(self) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10138,7 +10288,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_BaseSingleton); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) @@ -10196,13 +10346,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_3 = 0; /* "dependency_injector/containers.pyx":337 - * """Apply container providers' overridings.""" - * for provider in self.traverse(types=[providers.Container]): - * provider.apply_overridings() # <<<<<<<<<<<<<< + * """Reset container singletons.""" + * for provider in self.traverse(types=[providers.BaseSingleton]): + * provider.reset() # <<<<<<<<<<<<<< + * return SingletonResetContext(self) * - * def reset_singletons(self): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_apply_overridings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -10222,175 +10372,6 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dependency_injector/containers.pyx":336 - * def apply_container_providers_overridings(self): - * """Apply container providers' overridings.""" - * for provider in self.traverse(types=[providers.Container]): # <<<<<<<<<<<<<< - * provider.apply_overridings() - * - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "dependency_injector/containers.pyx":334 - * return _sync_ordered_shutdown(resources) - * - * def apply_container_providers_overridings(self): # <<<<<<<<<<<<<< - * """Apply container providers' overridings.""" - * for provider in self.traverse(types=[providers.Container]): - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.apply_container_providers_overridings", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_provider); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "dependency_injector/containers.pyx":339 - * provider.apply_overridings() - * - * def reset_singletons(self): # <<<<<<<<<<<<<< - * """Reset container singletons.""" - * for provider in self.traverse(types=[providers.BaseSingleton]): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_36reset_singletons(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_19dependency_injector_10containers_16DynamicContainer_35reset_singletons[] = "Reset container singletons."; -static PyMethodDef __pyx_mdef_19dependency_injector_10containers_16DynamicContainer_36reset_singletons = {"reset_singletons", (PyCFunction)__pyx_pw_19dependency_injector_10containers_16DynamicContainer_36reset_singletons, METH_O, __pyx_doc_19dependency_injector_10containers_16DynamicContainer_35reset_singletons}; -static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_36reset_singletons(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("reset_singletons (wrapper)", 0); - __pyx_r = __pyx_pf_19dependency_injector_10containers_16DynamicContainer_35reset_singletons(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_35reset_singletons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_provider = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("reset_singletons", 0); - - /* "dependency_injector/containers.pyx":341 - * def reset_singletons(self): - * """Reset container singletons.""" - * for provider in self.traverse(types=[providers.BaseSingleton]): # <<<<<<<<<<<<<< - * provider.reset() - * return SingletonResetContext(self) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_BaseSingleton); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_t_3) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 341, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 341, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 341, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_3); - __pyx_t_3 = 0; - - /* "dependency_injector/containers.pyx":342 - * """Reset container singletons.""" - * for provider in self.traverse(types=[providers.BaseSingleton]): - * provider.reset() # <<<<<<<<<<<<<< - * return SingletonResetContext(self) - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "dependency_injector/containers.pyx":341 * def reset_singletons(self): * """Reset container singletons.""" * for provider in self.traverse(types=[providers.BaseSingleton]): # <<<<<<<<<<<<<< @@ -10400,7 +10381,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":343 + /* "dependency_injector/containers.pyx":338 * for provider in self.traverse(types=[providers.BaseSingleton]): * provider.reset() * return SingletonResetContext(self) # <<<<<<<<<<<<<< @@ -10408,7 +10389,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * def check_dependencies(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SingletonResetContext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SingletonResetContext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -10422,14 +10403,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":339 + /* "dependency_injector/containers.pyx":334 * provider.apply_overridings() * * def reset_singletons(self): # <<<<<<<<<<<<<< @@ -10452,7 +10433,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":345 +/* "dependency_injector/containers.pyx":340 * return SingletonResetContext(self) * * def check_dependencies(self): # <<<<<<<<<<<<<< @@ -10498,40 +10479,40 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_dependencies", 0); - /* "dependency_injector/containers.pyx":350 + /* "dependency_injector/containers.pyx":345 * If any dependency is undefined, raises an error. * """ * undefined = [ # <<<<<<<<<<<<<< * dependency * for dependency in self.traverse(types=[providers.Dependency]) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":352 + /* "dependency_injector/containers.pyx":347 * undefined = [ * dependency * for dependency in self.traverse(types=[providers.Dependency]) # <<<<<<<<<<<<<< * if not dependency.is_defined * ] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_providers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_providers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Dependency); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Dependency); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_types, __pyx_t_4) < 0) __PYX_ERR(0, 352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_types, __pyx_t_4) < 0) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10539,9 +10520,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_3 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __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, 352, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -10549,17 +10530,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ 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_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 347, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 347, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -10569,7 +10550,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 352, __pyx_L1_error) + else __PYX_ERR(0, 347, __pyx_L1_error) } break; } @@ -10578,30 +10559,30 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XDECREF_SET(__pyx_v_dependency, __pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":353 + /* "dependency_injector/containers.pyx":348 * dependency * for dependency in self.traverse(types=[providers.Dependency]) * if not dependency.is_defined # <<<<<<<<<<<<<< * ] * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependency, __pyx_n_s_is_defined); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependency, __pyx_n_s_is_defined); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = ((!__pyx_t_8) != 0); if (__pyx_t_9) { - /* "dependency_injector/containers.pyx":351 + /* "dependency_injector/containers.pyx":346 * """ * undefined = [ * dependency # <<<<<<<<<<<<<< * for dependency in self.traverse(types=[providers.Dependency]) * if not dependency.is_defined */ - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_dependency))) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_dependency))) __PYX_ERR(0, 345, __pyx_L1_error) - /* "dependency_injector/containers.pyx":353 + /* "dependency_injector/containers.pyx":348 * dependency * for dependency in self.traverse(types=[providers.Dependency]) * if not dependency.is_defined # <<<<<<<<<<<<<< @@ -10610,7 +10591,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":352 + /* "dependency_injector/containers.pyx":347 * undefined = [ * dependency * for dependency in self.traverse(types=[providers.Dependency]) # <<<<<<<<<<<<<< @@ -10622,7 +10603,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_v_undefined = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":356 + /* "dependency_injector/containers.pyx":351 * ] * * if not undefined: # <<<<<<<<<<<<<< @@ -10633,7 +10614,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_8 = ((!__pyx_t_9) != 0); if (__pyx_t_8) { - /* "dependency_injector/containers.pyx":357 + /* "dependency_injector/containers.pyx":352 * * if not undefined: * return # <<<<<<<<<<<<<< @@ -10644,7 +10625,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "dependency_injector/containers.pyx":356 + /* "dependency_injector/containers.pyx":351 * ] * * if not undefined: # <<<<<<<<<<<<<< @@ -10653,26 +10634,26 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":359 + /* "dependency_injector/containers.pyx":354 * return * * container_name = self.parent_name if self.parent_name else self.__class__.__name__ # <<<<<<<<<<<<<< * undefined_names = [ * f'"{dependency.parent_name if dependency.parent_name else dependency}"' */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_4; @@ -10681,17 +10662,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_v_container_name = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":360 + /* "dependency_injector/containers.pyx":355 * * container_name = self.parent_name if self.parent_name else self.__class__.__name__ * undefined_names = [ # <<<<<<<<<<<<<< * f'"{dependency.parent_name if dependency.parent_name else dependency}"' * for dependency in undefined */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":362 + /* "dependency_injector/containers.pyx":357 * undefined_names = [ * f'"{dependency.parent_name if dependency.parent_name else dependency}"' * for dependency in undefined # <<<<<<<<<<<<<< @@ -10702,35 +10683,35 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_dependency, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":361 + /* "dependency_injector/containers.pyx":356 * container_name = self.parent_name if self.parent_name else self.__class__.__name__ * undefined_names = [ * f'"{dependency.parent_name if dependency.parent_name else dependency}"' # <<<<<<<<<<<<<< * for dependency in undefined * ] */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = 127; - __Pyx_INCREF(__pyx_kp_u__17); + __Pyx_INCREF(__pyx_kp_u__11); __pyx_t_10 += 1; - __Pyx_GIVEREF(__pyx_kp_u__17); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__17); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependency, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__11); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__11); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependency, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependency, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dependency, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; @@ -10738,7 +10719,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_INCREF(__pyx_v_dependency); __pyx_t_2 = __pyx_v_dependency; } - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11; @@ -10746,17 +10727,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__17); + __Pyx_INCREF(__pyx_kp_u__11); __pyx_t_10 += 1; - __Pyx_GIVEREF(__pyx_kp_u__17); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__17); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__11); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__11); + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 360, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/containers.pyx":362 + /* "dependency_injector/containers.pyx":357 * undefined_names = [ * f'"{dependency.parent_name if dependency.parent_name else dependency}"' * for dependency in undefined # <<<<<<<<<<<<<< @@ -10768,27 +10749,27 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_v_undefined_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":364 + /* "dependency_injector/containers.pyx":359 * for dependency in undefined * ] * raise errors.Error( # <<<<<<<<<<<<<< * f'Container "{container_name}" has undefined dependencies: ' * f'{", ".join(undefined_names)}', */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":365 + /* "dependency_injector/containers.pyx":360 * ] * raise errors.Error( * f'Container "{container_name}" has undefined dependencies: ' # <<<<<<<<<<<<<< * f'{", ".join(undefined_names)}', * ) */ - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_11 = 127; @@ -10796,7 +10777,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_6 += 11; __Pyx_GIVEREF(__pyx_kp_u_Container_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Container_2); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_container_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_container_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11; __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); @@ -10808,16 +10789,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_GIVEREF(__pyx_kp_u_has_undefined_dependencies); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_has_undefined_dependencies); - /* "dependency_injector/containers.pyx":366 + /* "dependency_injector/containers.pyx":361 * raise errors.Error( * f'Container "{container_name}" has undefined dependencies: ' * f'{", ".join(undefined_names)}', # <<<<<<<<<<<<<< * ) * */ - __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__18, __pyx_v_undefined_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__12, __pyx_v_undefined_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); 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_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11; @@ -10826,14 +10807,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":365 + /* "dependency_injector/containers.pyx":360 * ] * raise errors.Error( * f'Container "{container_name}" has undefined dependencies: ' # <<<<<<<<<<<<<< * f'{", ".join(undefined_names)}', * ) */ - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -10849,14 +10830,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 364, __pyx_L1_error) + __PYX_ERR(0, 359, __pyx_L1_error) - /* "dependency_injector/containers.pyx":345 + /* "dependency_injector/containers.pyx":340 * return SingletonResetContext(self) * * def check_dependencies(self): # <<<<<<<<<<<<<< @@ -10883,7 +10864,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":369 +/* "dependency_injector/containers.pyx":364 * ) * * def from_schema(self, schema): # <<<<<<<<<<<<<< @@ -10927,11 +10908,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("from_schema", 1, 2, 2, 1); __PYX_ERR(0, 369, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_schema", 1, 2, 2, 1); __PYX_ERR(0, 364, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_schema") < 0)) __PYX_ERR(0, 369, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_schema") < 0)) __PYX_ERR(0, 364, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -10944,7 +10925,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("from_schema", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 369, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_schema", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.from_schema", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10977,29 +10958,29 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_schema", 0); - /* "dependency_injector/containers.pyx":371 + /* "dependency_injector/containers.pyx":366 * def from_schema(self, schema): * """Build container providers from schema.""" * from .schema import build_schema # <<<<<<<<<<<<<< * for name, provider in build_schema(schema).items(): * self.set_provider(name, provider) */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_build_schema); __Pyx_GIVEREF(__pyx_n_s_build_schema); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_build_schema); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_schema, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_schema, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_build_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_build_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_build_schema = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":372 + /* "dependency_injector/containers.pyx":367 * """Build container providers from schema.""" * from .schema import build_schema * for name, provider in build_schema(schema).items(): # <<<<<<<<<<<<<< @@ -11019,10 +11000,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_schema); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -11037,16 +11018,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __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, 372, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11054,17 +11035,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ 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_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 367, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 367, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -11074,7 +11055,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 372, __pyx_L1_error) + else __PYX_ERR(0, 367, __pyx_L1_error) } break; } @@ -11086,7 +11067,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 372, __pyx_L1_error) + __PYX_ERR(0, 367, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11099,15 +11080,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __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_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -11115,7 +11096,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 372, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 367, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -11123,7 +11104,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 372, __pyx_L1_error) + __PYX_ERR(0, 367, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); @@ -11131,14 +11112,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":373 + /* "dependency_injector/containers.pyx":368 * from .schema import build_schema * for name, provider in build_schema(schema).items(): * self.set_provider(name, provider) # <<<<<<<<<<<<<< * * def from_yaml_schema(self, filepath, loader=None): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_provider); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_provider); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_9 = 0; @@ -11155,7 +11136,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_name, __pyx_v_provider}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -11163,13 +11144,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_name, __pyx_v_provider}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -11180,14 +11161,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_INCREF(__pyx_v_provider); __Pyx_GIVEREF(__pyx_v_provider); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_v_provider); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":372 + /* "dependency_injector/containers.pyx":367 * """Build container providers from schema.""" * from .schema import build_schema * for name, provider in build_schema(schema).items(): # <<<<<<<<<<<<<< @@ -11197,7 +11178,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":369 + /* "dependency_injector/containers.pyx":364 * ) * * def from_schema(self, schema): # <<<<<<<<<<<<<< @@ -11225,7 +11206,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":375 +/* "dependency_injector/containers.pyx":370 * self.set_provider(name, provider) * * def from_yaml_schema(self, filepath, loader=None): # <<<<<<<<<<<<<< @@ -11273,7 +11254,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("from_yaml_schema", 0, 2, 3, 1); __PYX_ERR(0, 375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_yaml_schema", 0, 2, 3, 1); __PYX_ERR(0, 370, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -11283,7 +11264,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_yaml_schema") < 0)) __PYX_ERR(0, 375, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_yaml_schema") < 0)) __PYX_ERR(0, 370, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -11301,7 +11282,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("from_yaml_schema", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_yaml_schema", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 370, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.from_yaml_schema", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11337,30 +11318,30 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_RefNannySetupContext("from_yaml_schema", 0); __Pyx_INCREF(__pyx_v_loader); - /* "dependency_injector/containers.pyx":381 + /* "dependency_injector/containers.pyx":376 * uses ``SafeLoader``. * """ * if yaml is None: # <<<<<<<<<<<<<< * raise errors.Error( * 'Unable to load yaml schema - PyYAML is not installed. ' */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_yaml); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_yaml); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (unlikely(__pyx_t_3)) { - /* "dependency_injector/containers.pyx":382 + /* "dependency_injector/containers.pyx":377 * """ * if yaml is None: * raise errors.Error( # <<<<<<<<<<<<<< * 'Unable to load yaml schema - PyYAML is not installed. ' * 'Install PyYAML or install Dependency Injector with yaml extras: ' */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -11375,14 +11356,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_kp_s_Unable_to_load_yaml_schema_PyYAM) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_Unable_to_load_yaml_schema_PyYAM); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 382, __pyx_L1_error) + __PYX_ERR(0, 377, __pyx_L1_error) - /* "dependency_injector/containers.pyx":381 + /* "dependency_injector/containers.pyx":376 * uses ``SafeLoader``. * """ * if yaml is None: # <<<<<<<<<<<<<< @@ -11391,7 +11372,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":388 + /* "dependency_injector/containers.pyx":383 * ) * * if loader is None: # <<<<<<<<<<<<<< @@ -11402,22 +11383,22 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "dependency_injector/containers.pyx":389 + /* "dependency_injector/containers.pyx":384 * * if loader is None: * loader = yaml.SafeLoader # <<<<<<<<<<<<<< * * with open(filepath) as file: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_yaml); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_yaml); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SafeLoader); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SafeLoader); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_loader, __pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/containers.pyx":388 + /* "dependency_injector/containers.pyx":383 * ) * * if loader is None: # <<<<<<<<<<<<<< @@ -11426,7 +11407,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":391 + /* "dependency_injector/containers.pyx":386 * loader = yaml.SafeLoader * * with open(filepath) as file: # <<<<<<<<<<<<<< @@ -11434,11 +11415,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * */ /*with:*/ { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_filepath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_filepath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -11452,7 +11433,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L5_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_1; @@ -11470,16 +11451,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_v_file = __pyx_t_4; __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":392 + /* "dependency_injector/containers.pyx":387 * * with open(filepath) as file: * schema = yaml.load(file, loader) # <<<<<<<<<<<<<< * * self.from_schema(schema) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_yaml); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L9_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_yaml); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_load); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L9_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_load); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -11497,7 +11478,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_file, __pyx_v_loader}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L9_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -11505,13 +11486,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_file, __pyx_v_loader}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L9_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 392, __pyx_L9_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -11522,7 +11503,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_INCREF(__pyx_v_loader); __Pyx_GIVEREF(__pyx_v_loader); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_v_loader); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L9_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -11530,7 +11511,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_v_schema = __pyx_t_4; __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":391 + /* "dependency_injector/containers.pyx":386 * loader = yaml.SafeLoader * * with open(filepath) as file: # <<<<<<<<<<<<<< @@ -11549,20 +11530,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.from_yaml_schema", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 391, __pyx_L11_except_error) + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 386, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L11_except_error) + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 391, __pyx_L11_except_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 386, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__pyx_t_2 < 0) __PYX_ERR(0, 391, __pyx_L11_except_error) + if (__pyx_t_2 < 0) __PYX_ERR(0, 386, __pyx_L11_except_error) __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_4); @@ -11570,7 +11551,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0; - __PYX_ERR(0, 391, __pyx_L11_except_error) + __PYX_ERR(0, 386, __pyx_L11_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11594,9 +11575,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__19, NULL); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__13, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -11611,16 +11592,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_L18:; } - /* "dependency_injector/containers.pyx":394 + /* "dependency_injector/containers.pyx":389 * schema = yaml.load(file, loader) * * self.from_schema(schema) # <<<<<<<<<<<<<< * * def from_json_schema(self, filepath): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_v_schema)) { __Pyx_RaiseUnboundLocalError("schema"); __PYX_ERR(0, 394, __pyx_L1_error) } + if (unlikely(!__pyx_v_schema)) { __Pyx_RaiseUnboundLocalError("schema"); __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); @@ -11633,12 +11614,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_schema); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":375 + /* "dependency_injector/containers.pyx":370 * self.set_provider(name, provider) * * def from_yaml_schema(self, filepath, loader=None): # <<<<<<<<<<<<<< @@ -11665,7 +11646,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":396 +/* "dependency_injector/containers.pyx":391 * self.from_schema(schema) * * def from_json_schema(self, filepath): # <<<<<<<<<<<<<< @@ -11709,11 +11690,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("from_json_schema", 1, 2, 2, 1); __PYX_ERR(0, 396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_json_schema", 1, 2, 2, 1); __PYX_ERR(0, 391, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_json_schema") < 0)) __PYX_ERR(0, 396, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_json_schema") < 0)) __PYX_ERR(0, 391, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -11726,7 +11707,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("from_json_schema", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_json_schema", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 391, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.from_json_schema", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11760,7 +11741,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_json_schema", 0); - /* "dependency_injector/containers.pyx":398 + /* "dependency_injector/containers.pyx":393 * def from_json_schema(self, filepath): * """Build container providers from JSON schema.""" * with open(filepath) as file: # <<<<<<<<<<<<<< @@ -11768,11 +11749,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * self.from_schema(schema) */ /*with:*/ { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L3_error) + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -11786,7 +11767,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L3_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_3; @@ -11804,16 +11785,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_v_file = __pyx_t_4; __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":399 + /* "dependency_injector/containers.pyx":394 * """Build container providers from JSON schema.""" * with open(filepath) as file: * schema = json.load(file) # <<<<<<<<<<<<<< * self.from_schema(schema) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_json); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L7_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_json); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -11828,13 +11809,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_file) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_file); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L7_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_schema = __pyx_t_4; __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":398 + /* "dependency_injector/containers.pyx":393 * def from_json_schema(self, filepath): * """Build container providers from JSON schema.""" * with open(filepath) as file: # <<<<<<<<<<<<<< @@ -11853,20 +11834,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.from_json_schema", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 398, __pyx_L9_except_error) + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 393, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L9_except_error) + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L9_except_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_10 < 0) __PYX_ERR(0, 398, __pyx_L9_except_error) + if (__pyx_t_10 < 0) __PYX_ERR(0, 393, __pyx_L9_except_error) __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_4); @@ -11874,7 +11855,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_1); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; - __PYX_ERR(0, 398, __pyx_L9_except_error) + __PYX_ERR(0, 393, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11898,9 +11879,9 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__19, NULL); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 398, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -11915,16 +11896,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_L16:; } - /* "dependency_injector/containers.pyx":400 + /* "dependency_injector/containers.pyx":395 * with open(filepath) as file: * schema = json.load(file) * self.from_schema(schema) # <<<<<<<<<<<<<< * * def resolve_provider_name(self, provider): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(!__pyx_v_schema)) { __Pyx_RaiseUnboundLocalError("schema"); __PYX_ERR(0, 400, __pyx_L1_error) } + if (unlikely(!__pyx_v_schema)) { __Pyx_RaiseUnboundLocalError("schema"); __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); @@ -11937,12 +11918,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_schema); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":396 + /* "dependency_injector/containers.pyx":391 * self.from_schema(schema) * * def from_json_schema(self, filepath): # <<<<<<<<<<<<<< @@ -11968,7 +11949,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":402 +/* "dependency_injector/containers.pyx":397 * self.from_schema(schema) * * def resolve_provider_name(self, provider): # <<<<<<<<<<<<<< @@ -12012,11 +11993,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_provider)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, 1); __PYX_ERR(0, 402, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, 1); __PYX_ERR(0, 397, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolve_provider_name") < 0)) __PYX_ERR(0, 402, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolve_provider_name") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -12029,7 +12010,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.resolve_provider_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12064,16 +12045,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resolve_provider_name", 0); - /* "dependency_injector/containers.pyx":404 + /* "dependency_injector/containers.pyx":399 * def resolve_provider_name(self, provider): * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): # <<<<<<<<<<<<<< * if container_provider is provider: * return provider_name */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12088,16 +12069,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -12105,17 +12086,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -12125,7 +12106,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 404, __pyx_L1_error) + else __PYX_ERR(0, 399, __pyx_L1_error) } break; } @@ -12137,7 +12118,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 404, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12150,15 +12131,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __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; @@ -12166,7 +12147,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 404, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -12174,7 +12155,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 404, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_provider_name, __pyx_t_2); @@ -12182,7 +12163,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_XDECREF_SET(__pyx_v_container_provider, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":405 + /* "dependency_injector/containers.pyx":400 * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): * if container_provider is provider: # <<<<<<<<<<<<<< @@ -12193,7 +12174,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { - /* "dependency_injector/containers.pyx":406 + /* "dependency_injector/containers.pyx":401 * for provider_name, container_provider in self.providers.items(): * if container_provider is provider: * return provider_name # <<<<<<<<<<<<<< @@ -12206,7 +12187,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":405 + /* "dependency_injector/containers.pyx":400 * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): * if container_provider is provider: # <<<<<<<<<<<<<< @@ -12215,7 +12196,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":404 + /* "dependency_injector/containers.pyx":399 * def resolve_provider_name(self, provider): * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): # <<<<<<<<<<<<<< @@ -12225,19 +12206,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ } /*else*/ { - /* "dependency_injector/containers.pyx":408 + /* "dependency_injector/containers.pyx":403 * return provider_name * else: * raise errors.Error(f'Can not resolve name for provider "{provider}"') # <<<<<<<<<<<<<< * * @property */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = 0; __pyx_t_12 = 127; @@ -12245,18 +12226,18 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_11 += 35; __Pyx_GIVEREF(__pyx_kp_u_Can_not_resolve_name_for_provide); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Can_not_resolve_name_for_provide); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_provider, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_provider, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12; __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); __pyx_t_7 = 0; - __Pyx_INCREF(__pyx_kp_u__17); + __Pyx_INCREF(__pyx_kp_u__11); __pyx_t_11 += 1; - __Pyx_GIVEREF(__pyx_kp_u__17); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__17); - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__11); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__11); + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -12272,15 +12253,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 408, __pyx_L1_error) + __PYX_ERR(0, 403, __pyx_L1_error) } - /* "dependency_injector/containers.pyx":404 + /* "dependency_injector/containers.pyx":399 * def resolve_provider_name(self, provider): * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): # <<<<<<<<<<<<<< @@ -12289,7 +12270,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":402 + /* "dependency_injector/containers.pyx":397 * self.from_schema(schema) * * def resolve_provider_name(self, provider): # <<<<<<<<<<<<<< @@ -12314,7 +12295,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":411 +/* "dependency_injector/containers.pyx":406 * * @property * def parent_name(self): # <<<<<<<<<<<<<< @@ -12348,20 +12329,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parent_name", 0); - /* "dependency_injector/containers.pyx":413 + /* "dependency_injector/containers.pyx":408 * def parent_name(self): * """Return parent name.""" * if self.parent: # <<<<<<<<<<<<<< * return self.parent.parent_name * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __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, 413, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "dependency_injector/containers.pyx":414 + /* "dependency_injector/containers.pyx":409 * """Return parent name.""" * if self.parent: * return self.parent.parent_name # <<<<<<<<<<<<<< @@ -12369,16 +12350,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * if self.declarative_parent: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parent_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":413 + /* "dependency_injector/containers.pyx":408 * def parent_name(self): * """Return parent name.""" * if self.parent: # <<<<<<<<<<<<<< @@ -12387,20 +12368,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":416 + /* "dependency_injector/containers.pyx":411 * return self.parent.parent_name * * if self.declarative_parent: # <<<<<<<<<<<<<< * return self.declarative_parent.__name__ * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_declarative_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_declarative_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "dependency_injector/containers.pyx":417 + /* "dependency_injector/containers.pyx":412 * * if self.declarative_parent: * return self.declarative_parent.__name__ # <<<<<<<<<<<<<< @@ -12408,16 +12389,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_declarative_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_declarative_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":416 + /* "dependency_injector/containers.pyx":411 * return self.parent.parent_name * * if self.declarative_parent: # <<<<<<<<<<<<<< @@ -12426,7 +12407,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ */ } - /* "dependency_injector/containers.pyx":419 + /* "dependency_injector/containers.pyx":414 * return self.declarative_parent.__name__ * * return None # <<<<<<<<<<<<<< @@ -12437,7 +12418,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "dependency_injector/containers.pyx":411 + /* "dependency_injector/containers.pyx":406 * * @property * def parent_name(self): # <<<<<<<<<<<<<< @@ -12457,7 +12438,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":421 +/* "dependency_injector/containers.pyx":416 * return None * * def assign_parent(self, parent): # <<<<<<<<<<<<<< @@ -12501,11 +12482,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_parent", 1, 2, 2, 1); __PYX_ERR(0, 421, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_parent", 1, 2, 2, 1); __PYX_ERR(0, 416, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_parent") < 0)) __PYX_ERR(0, 421, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_parent") < 0)) __PYX_ERR(0, 416, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -12518,7 +12499,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_16DynamicContainer_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("assign_parent", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 421, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_parent", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 416, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DynamicContainer.assign_parent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12539,16 +12520,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_parent", 0); - /* "dependency_injector/containers.pyx":423 + /* "dependency_injector/containers.pyx":418 * def assign_parent(self, parent): * """Assign parent.""" * self.parent = parent # <<<<<<<<<<<<<< * * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - /* "dependency_injector/containers.pyx":421 + /* "dependency_injector/containers.pyx":416 * return None * * def assign_parent(self, parent): # <<<<<<<<<<<<<< @@ -12568,7 +12549,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_16DynamicContainer_ return __pyx_r; } -/* "dependency_injector/containers.pyx":429 +/* "dependency_injector/containers.pyx":424 * """Declarative inversion of control container meta class.""" * * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< @@ -12618,23 +12599,23 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_class_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 1); __PYX_ERR(0, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 1); __PYX_ERR(0, 424, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bases)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 2); __PYX_ERR(0, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 2); __PYX_ERR(0, 424, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attributes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 3); __PYX_ERR(0, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 3); __PYX_ERR(0, 424, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 424, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -12651,16 +12632,16 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 424, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainerMetaClass.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); __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, 429, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_name), (&PyString_Type), 1, "class_name", 1))) __PYX_ERR(0, 429, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bases), (&PyTuple_Type), 1, "bases", 1))) __PYX_ERR(0, 429, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attributes), (&PyDict_Type), 1, "attributes", 1))) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mcs), (&PyType_Type), 1, "mcs", 1))) __PYX_ERR(0, 424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_name), (&PyString_Type), 1, "class_name", 1))) __PYX_ERR(0, 424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bases), (&PyTuple_Type), 1, "bases", 1))) __PYX_ERR(0, 424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attributes), (&PyDict_Type), 1, "attributes", 1))) __PYX_ERR(0, 424, __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 */ @@ -12680,13 +12661,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject *__pyx_v_all_providers = NULL; PyTypeObject *__pyx_v_cls = NULL; PyObject *__pyx_v_provider = NULL; - PyObject *__pyx_8genexpr3__pyx_v_name = NULL; - PyObject *__pyx_8genexpr3__pyx_v_container = NULL; PyObject *__pyx_8genexpr4__pyx_v_name = NULL; - PyObject *__pyx_8genexpr4__pyx_v_provider = NULL; - PyObject *__pyx_8genexpr5__pyx_v_base = NULL; + PyObject *__pyx_8genexpr4__pyx_v_container = NULL; PyObject *__pyx_8genexpr5__pyx_v_name = NULL; PyObject *__pyx_8genexpr5__pyx_v_provider = NULL; + PyObject *__pyx_8genexpr6__pyx_v_base = NULL; + PyObject *__pyx_8genexpr6__pyx_v_name = NULL; + PyObject *__pyx_8genexpr6__pyx_v_provider = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -12709,14 +12690,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__new__", 0); - /* "dependency_injector/containers.pyx":431 + /* "dependency_injector/containers.pyx":426 * def __new__(type mcs, str class_name, tuple bases, dict attributes): * """Declarative container class factory.""" * self = mcs.__fetch_self(attributes) # <<<<<<<<<<<<<< * if self is None: * self = providers.Self() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mcs), __pyx_n_s_DeclarativeContainerMetaClass); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mcs), __pyx_n_s_DeclarativeContainerMetaClass); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -12730,13 +12711,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_attributes) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_attributes); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":432 + /* "dependency_injector/containers.pyx":427 * """Declarative container class factory.""" * self = mcs.__fetch_self(attributes) * if self is None: # <<<<<<<<<<<<<< @@ -12747,16 +12728,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "dependency_injector/containers.pyx":433 + /* "dependency_injector/containers.pyx":428 * self = mcs.__fetch_self(attributes) * if self is None: * self = providers.Self() # <<<<<<<<<<<<<< * * containers = { */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12771,13 +12752,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_self, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":432 + /* "dependency_injector/containers.pyx":427 * """Declarative container class factory.""" * self = mcs.__fetch_self(attributes) * if self is None: # <<<<<<<<<<<<<< @@ -12786,7 +12767,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":435 + /* "dependency_injector/containers.pyx":430 * self = providers.Self() * * containers = { # <<<<<<<<<<<<<< @@ -12794,19 +12775,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai * for name, container in six.iteritems(attributes) */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L6_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":437 + /* "dependency_injector/containers.pyx":432 * containers = { * name: container * for name, container in six.iteritems(attributes) # <<<<<<<<<<<<<< * if is_container(container) * } */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12821,16 +12802,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_attributes) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_attributes); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L6_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12838,17 +12819,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 432, __pyx_L6_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 432, __pyx_L6_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -12858,7 +12839,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 437, __pyx_L6_error) + else __PYX_ERR(0, 432, __pyx_L6_error) } break; } @@ -12870,7 +12851,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 437, __pyx_L6_error) + __PYX_ERR(0, 432, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12883,15 +12864,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 437, __pyx_L6_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 432, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; @@ -12899,7 +12880,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 437, __pyx_L6_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 432, __pyx_L6_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10_unpacking_done; @@ -12907,34 +12888,34 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 437, __pyx_L6_error) + __PYX_ERR(0, 432, __pyx_L6_error) __pyx_L10_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_name, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_container, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_container, __pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":438 + /* "dependency_injector/containers.pyx":433 * name: container * for name, container in six.iteritems(attributes) * if is_container(container) # <<<<<<<<<<<<<< * } * */ - __pyx_t_5 = (__pyx_f_19dependency_injector_10containers_is_container(__pyx_8genexpr3__pyx_v_container, 0) != 0); + __pyx_t_5 = (__pyx_f_19dependency_injector_10containers_is_container(__pyx_8genexpr4__pyx_v_container, 0) != 0); if (__pyx_t_5) { - /* "dependency_injector/containers.pyx":436 + /* "dependency_injector/containers.pyx":431 * * containers = { * name: container # <<<<<<<<<<<<<< * for name, container in six.iteritems(attributes) * if is_container(container) */ - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr3__pyx_v_name, (PyObject*)__pyx_8genexpr3__pyx_v_container))) __PYX_ERR(0, 436, __pyx_L6_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_name, (PyObject*)__pyx_8genexpr4__pyx_v_container))) __PYX_ERR(0, 431, __pyx_L6_error) - /* "dependency_injector/containers.pyx":438 + /* "dependency_injector/containers.pyx":433 * name: container * for name, container in six.iteritems(attributes) * if is_container(container) # <<<<<<<<<<<<<< @@ -12943,7 +12924,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":437 + /* "dependency_injector/containers.pyx":432 * containers = { * name: container * for name, container in six.iteritems(attributes) # <<<<<<<<<<<<<< @@ -12952,19 +12933,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_container); __pyx_8genexpr3__pyx_v_container = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_name); __pyx_8genexpr3__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_container); __pyx_8genexpr4__pyx_v_container = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0; goto __pyx_L12_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_container); __pyx_8genexpr3__pyx_v_container = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_name); __pyx_8genexpr3__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_container); __pyx_8genexpr4__pyx_v_container = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __pyx_v_containers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":441 + /* "dependency_injector/containers.pyx":436 * } * * cls_providers = { # <<<<<<<<<<<<<< @@ -12972,19 +12953,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai * for name, provider in six.iteritems(attributes) */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L15_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":443 + /* "dependency_injector/containers.pyx":438 * cls_providers = { * name: provider * for name, provider in six.iteritems(attributes) # <<<<<<<<<<<<<< * if isinstance(provider, providers.Provider) and not isinstance(provider, providers.Self) * } */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L15_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -12999,16 +12980,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_v_attributes) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_attributes); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L15_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_9 = __pyx_t_6; __Pyx_INCREF(__pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L15_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { @@ -13016,17 +12997,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 438, __pyx_L15_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 438, __pyx_L15_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -13036,7 +13017,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 443, __pyx_L15_error) + else __PYX_ERR(0, 438, __pyx_L15_error) } break; } @@ -13048,7 +13029,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 443, __pyx_L15_error) + __PYX_ERR(0, 438, __pyx_L15_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13061,15 +13042,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 443, __pyx_L15_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 438, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; @@ -13077,7 +13058,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 443, __pyx_L15_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 438, __pyx_L15_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L19_unpacking_done; @@ -13085,27 +13066,27 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 443, __pyx_L15_error) + __PYX_ERR(0, 438, __pyx_L15_error) __pyx_L19_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_name, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_provider, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_provider, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":444 + /* "dependency_injector/containers.pyx":439 * name: provider * for name, provider in six.iteritems(attributes) * if isinstance(provider, providers.Provider) and not isinstance(provider, providers.Self) # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_providers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L15_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_providers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Provider); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L15_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Provider); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = PyObject_IsInstance(__pyx_8genexpr4__pyx_v_provider, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 444, __pyx_L15_error) + __pyx_t_4 = PyObject_IsInstance(__pyx_8genexpr5__pyx_v_provider, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 439, __pyx_L15_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = (__pyx_t_4 != 0); if (__pyx_t_12) { @@ -13113,28 +13094,28 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_5 = __pyx_t_12; goto __pyx_L21_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L15_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L15_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = PyObject_IsInstance(__pyx_8genexpr4__pyx_v_provider, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 444, __pyx_L15_error) + __pyx_t_12 = PyObject_IsInstance(__pyx_8genexpr5__pyx_v_provider, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 439, __pyx_L15_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = ((!(__pyx_t_12 != 0)) != 0); __pyx_t_5 = __pyx_t_4; __pyx_L21_bool_binop_done:; if (__pyx_t_5) { - /* "dependency_injector/containers.pyx":442 + /* "dependency_injector/containers.pyx":437 * * cls_providers = { * name: provider # <<<<<<<<<<<<<< * for name, provider in six.iteritems(attributes) * if isinstance(provider, providers.Provider) and not isinstance(provider, providers.Self) */ - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_name, (PyObject*)__pyx_8genexpr4__pyx_v_provider))) __PYX_ERR(0, 442, __pyx_L15_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr5__pyx_v_name, (PyObject*)__pyx_8genexpr5__pyx_v_provider))) __PYX_ERR(0, 437, __pyx_L15_error) - /* "dependency_injector/containers.pyx":444 + /* "dependency_injector/containers.pyx":439 * name: provider * for name, provider in six.iteritems(attributes) * if isinstance(provider, providers.Provider) and not isinstance(provider, providers.Self) # <<<<<<<<<<<<<< @@ -13143,7 +13124,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":443 + /* "dependency_injector/containers.pyx":438 * cls_providers = { * name: provider * for name, provider in six.iteritems(attributes) # <<<<<<<<<<<<<< @@ -13152,19 +13133,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_provider); __pyx_8genexpr4__pyx_v_provider = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __pyx_8genexpr5__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_provider); __pyx_8genexpr5__pyx_v_provider = 0; goto __pyx_L23_exit_scope; __pyx_L15_error:; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_provider); __pyx_8genexpr4__pyx_v_provider = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __pyx_8genexpr5__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_provider); __pyx_8genexpr5__pyx_v_provider = 0; goto __pyx_L1_error; __pyx_L23_exit_scope:; } /* exit inner scope */ __pyx_v_cls_providers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":447 + /* "dependency_injector/containers.pyx":442 * } * * inherited_providers = { # <<<<<<<<<<<<<< @@ -13172,10 +13153,10 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai * for base in bases */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L26_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":449 + /* "dependency_injector/containers.pyx":444 * inherited_providers = { * name: provider * for base in bases # <<<<<<<<<<<<<< @@ -13184,55 +13165,55 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ if (unlikely(__pyx_v_bases == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 449, __pyx_L26_error) + __PYX_ERR(0, 444, __pyx_L26_error) } __pyx_t_9 = __pyx_v_bases; __Pyx_INCREF(__pyx_t_9); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 449, __pyx_L26_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 444, __pyx_L26_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L26_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); #endif - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_base, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_base, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":450 + /* "dependency_injector/containers.pyx":445 * name: provider * for base in bases * if is_container(base) and base is not DynamicContainer # <<<<<<<<<<<<<< * for name, provider in six.iteritems(base.providers) * } */ - __pyx_t_4 = (__pyx_f_19dependency_injector_10containers_is_container(__pyx_8genexpr5__pyx_v_base, 0) != 0); + __pyx_t_4 = (__pyx_f_19dependency_injector_10containers_is_container(__pyx_8genexpr6__pyx_v_base, 0) != 0); if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L30_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L26_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = (__pyx_8genexpr5__pyx_v_base != __pyx_t_6); + __pyx_t_4 = (__pyx_8genexpr6__pyx_v_base != __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = (__pyx_t_4 != 0); __pyx_t_5 = __pyx_t_12; __pyx_L30_bool_binop_done:; if (__pyx_t_5) { - /* "dependency_injector/containers.pyx":451 + /* "dependency_injector/containers.pyx":446 * for base in bases * if is_container(base) and base is not DynamicContainer * for name, provider in six.iteritems(base.providers) # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L26_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L26_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, 451, __pyx_L26_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_base, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_base, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -13247,16 +13228,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L26_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L26_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { @@ -13264,17 +13245,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L26_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L26_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -13284,7 +13265,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 451, __pyx_L26_error) + else __PYX_ERR(0, 446, __pyx_L26_error) } break; } @@ -13296,7 +13277,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 451, __pyx_L26_error) + __PYX_ERR(0, 446, __pyx_L26_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13309,15 +13290,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_10); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 451, __pyx_L26_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 446, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_14)->tp_iternext; @@ -13325,7 +13306,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L34_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(0, 451, __pyx_L26_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(0, 446, __pyx_L26_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L35_unpacking_done; @@ -13333,24 +13314,24 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 451, __pyx_L26_error) + __PYX_ERR(0, 446, __pyx_L26_error) __pyx_L35_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_name, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_provider, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_provider, __pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":448 + /* "dependency_injector/containers.pyx":443 * * inherited_providers = { * name: provider # <<<<<<<<<<<<<< * for base in bases * if is_container(base) and base is not DynamicContainer */ - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr5__pyx_v_name, (PyObject*)__pyx_8genexpr5__pyx_v_provider))) __PYX_ERR(0, 448, __pyx_L26_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr6__pyx_v_name, (PyObject*)__pyx_8genexpr6__pyx_v_provider))) __PYX_ERR(0, 443, __pyx_L26_error) - /* "dependency_injector/containers.pyx":451 + /* "dependency_injector/containers.pyx":446 * for base in bases * if is_container(base) and base is not DynamicContainer * for name, provider in six.iteritems(base.providers) # <<<<<<<<<<<<<< @@ -13360,7 +13341,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":450 + /* "dependency_injector/containers.pyx":445 * name: provider * for base in bases * if is_container(base) and base is not DynamicContainer # <<<<<<<<<<<<<< @@ -13369,7 +13350,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":449 + /* "dependency_injector/containers.pyx":444 * inherited_providers = { * name: provider * for base in bases # <<<<<<<<<<<<<< @@ -13378,55 +13359,55 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_base); __pyx_8genexpr5__pyx_v_base = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __pyx_8genexpr5__pyx_v_name = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_provider); __pyx_8genexpr5__pyx_v_provider = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_base); __pyx_8genexpr6__pyx_v_base = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_name); __pyx_8genexpr6__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_provider); __pyx_8genexpr6__pyx_v_provider = 0; goto __pyx_L36_exit_scope; __pyx_L26_error:; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_base); __pyx_8genexpr5__pyx_v_base = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __pyx_8genexpr5__pyx_v_name = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_provider); __pyx_8genexpr5__pyx_v_provider = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_base); __pyx_8genexpr6__pyx_v_base = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_name); __pyx_8genexpr6__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_provider); __pyx_8genexpr6__pyx_v_provider = 0; goto __pyx_L1_error; __pyx_L36_exit_scope:; } /* exit inner scope */ __pyx_v_inherited_providers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":454 + /* "dependency_injector/containers.pyx":449 * } * * all_providers = {} # <<<<<<<<<<<<<< * all_providers.update(inherited_providers) * all_providers.update(cls_providers) */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_providers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":455 + /* "dependency_injector/containers.pyx":450 * * all_providers = {} * all_providers.update(inherited_providers) # <<<<<<<<<<<<<< * all_providers.update(cls_providers) * */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_all_providers, __pyx_v_inherited_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_all_providers, __pyx_v_inherited_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":456 + /* "dependency_injector/containers.pyx":451 * all_providers = {} * all_providers.update(inherited_providers) * all_providers.update(cls_providers) # <<<<<<<<<<<<<< * * attributes['containers'] = containers */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_all_providers, __pyx_v_cls_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_all_providers, __pyx_v_cls_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":458 + /* "dependency_injector/containers.pyx":453 * all_providers.update(cls_providers) * * attributes['containers'] = containers # <<<<<<<<<<<<<< @@ -13435,11 +13416,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 458, __pyx_L1_error) + __PYX_ERR(0, 453, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_containers, __pyx_v_containers) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_containers, __pyx_v_containers) < 0)) __PYX_ERR(0, 453, __pyx_L1_error) - /* "dependency_injector/containers.pyx":459 + /* "dependency_injector/containers.pyx":454 * * attributes['containers'] = containers * attributes['inherited_providers'] = inherited_providers # <<<<<<<<<<<<<< @@ -13448,11 +13429,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 459, __pyx_L1_error) + __PYX_ERR(0, 454, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_inherited_providers, __pyx_v_inherited_providers) < 0)) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_inherited_providers, __pyx_v_inherited_providers) < 0)) __PYX_ERR(0, 454, __pyx_L1_error) - /* "dependency_injector/containers.pyx":460 + /* "dependency_injector/containers.pyx":455 * attributes['containers'] = containers * attributes['inherited_providers'] = inherited_providers * attributes['cls_providers'] = cls_providers # <<<<<<<<<<<<<< @@ -13461,11 +13442,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 460, __pyx_L1_error) + __PYX_ERR(0, 455, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_cls_providers, __pyx_v_cls_providers) < 0)) __PYX_ERR(0, 460, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_cls_providers, __pyx_v_cls_providers) < 0)) __PYX_ERR(0, 455, __pyx_L1_error) - /* "dependency_injector/containers.pyx":461 + /* "dependency_injector/containers.pyx":456 * attributes['inherited_providers'] = inherited_providers * attributes['cls_providers'] = cls_providers * attributes['providers'] = all_providers # <<<<<<<<<<<<<< @@ -13474,18 +13455,18 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ if (unlikely(__pyx_v_attributes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 461, __pyx_L1_error) + __PYX_ERR(0, 456, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_providers, __pyx_v_all_providers) < 0)) __PYX_ERR(0, 461, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_n_s_providers, __pyx_v_all_providers) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) - /* "dependency_injector/containers.pyx":463 + /* "dependency_injector/containers.pyx":458 * attributes['providers'] = all_providers * * cls = type.__new__(mcs, class_name, bases, attributes) # <<<<<<<<<<<<<< * * self.set_container(cls) */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; __pyx_t_15 = 0; @@ -13502,7 +13483,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_mcs), __pyx_v_class_name, __pyx_v_bases, __pyx_v_attributes}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -13510,13 +13491,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_mcs), __pyx_v_class_name, __pyx_v_bases, __pyx_v_attributes}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_6 = PyTuple_New(4+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -13533,7 +13514,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_v_attributes); __Pyx_GIVEREF(__pyx_v_attributes); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_15, __pyx_v_attributes); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -13544,14 +13525,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_v_cls = ((PyTypeObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":465 + /* "dependency_injector/containers.pyx":460 * cls = type.__new__(mcs, class_name, bases, attributes) * * self.set_container(cls) # <<<<<<<<<<<<<< * cls.__self__ = self * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -13565,33 +13546,33 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, ((PyObject *)__pyx_v_cls)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_cls)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 465, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":466 + /* "dependency_injector/containers.pyx":461 * * self.set_container(cls) * cls.__self__ = self # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.providers): */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_self, __pyx_v_self) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_self, __pyx_v_self) < 0) __PYX_ERR(0, 461, __pyx_L1_error) - /* "dependency_injector/containers.pyx":468 + /* "dependency_injector/containers.pyx":463 * cls.__self__ = self * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * _check_provider_type(cls, provider) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -13606,16 +13587,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { __pyx_t_6 = __pyx_t_9; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -13623,17 +13604,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -13643,7 +13624,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 468, __pyx_L1_error) + else __PYX_ERR(0, 463, __pyx_L1_error) } break; } @@ -13652,18 +13633,18 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":469 + /* "dependency_injector/containers.pyx":464 * * for provider in six.itervalues(cls.providers): * _check_provider_type(cls, provider) # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.cls_providers): */ - __pyx_t_9 = __pyx_f_19dependency_injector_10containers__check_provider_type(((PyObject *)__pyx_v_cls), __pyx_v_provider, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_9 = __pyx_f_19dependency_injector_10containers__check_provider_type(((PyObject *)__pyx_v_cls), __pyx_v_provider, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":468 + /* "dependency_injector/containers.pyx":463 * cls.__self__ = self * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< @@ -13673,19 +13654,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":471 + /* "dependency_injector/containers.pyx":466 * _check_provider_type(cls, provider) * * for provider in six.itervalues(cls.cls_providers): # <<<<<<<<<<<<<< * if isinstance(provider, providers.CHILD_PROVIDERS): * provider.assign_parent(cls) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_six); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_six); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -13700,16 +13681,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { @@ -13717,17 +13698,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 466, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 466, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -13737,7 +13718,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 471, __pyx_L1_error) + else __PYX_ERR(0, 466, __pyx_L1_error) } break; } @@ -13746,31 +13727,31 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":472 + /* "dependency_injector/containers.pyx":467 * * for provider in six.itervalues(cls.cls_providers): * if isinstance(provider, providers.CHILD_PROVIDERS): # <<<<<<<<<<<<<< * provider.assign_parent(cls) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_providers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_providers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_CHILD_PROVIDERS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_CHILD_PROVIDERS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = PyObject_IsInstance(__pyx_v_provider, __pyx_t_9); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = PyObject_IsInstance(__pyx_v_provider, __pyx_t_9); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = (__pyx_t_5 != 0); if (__pyx_t_12) { - /* "dependency_injector/containers.pyx":473 + /* "dependency_injector/containers.pyx":468 * for provider in six.itervalues(cls.cls_providers): * if isinstance(provider, providers.CHILD_PROVIDERS): * provider.assign_parent(cls) # <<<<<<<<<<<<<< * * return cls */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_assign_parent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_assign_parent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -13784,12 +13765,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, ((PyObject *)__pyx_v_cls)) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_cls)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":472 + /* "dependency_injector/containers.pyx":467 * * for provider in six.itervalues(cls.cls_providers): * if isinstance(provider, providers.CHILD_PROVIDERS): # <<<<<<<<<<<<<< @@ -13798,7 +13779,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":471 + /* "dependency_injector/containers.pyx":466 * _check_provider_type(cls, provider) * * for provider in six.itervalues(cls.cls_providers): # <<<<<<<<<<<<<< @@ -13808,7 +13789,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":475 + /* "dependency_injector/containers.pyx":470 * provider.assign_parent(cls) * * return cls # <<<<<<<<<<<<<< @@ -13820,7 +13801,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_r = ((PyObject *)__pyx_v_cls); goto __pyx_L0; - /* "dependency_injector/containers.pyx":429 + /* "dependency_injector/containers.pyx":424 * """Declarative inversion of control container meta class.""" * * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< @@ -13847,19 +13828,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_XDECREF(__pyx_v_all_providers); __Pyx_XDECREF(__pyx_v_cls); __Pyx_XDECREF(__pyx_v_provider); - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_name); - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_container); __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_provider); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_base); + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_container); __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_provider); + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_base); + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_name); + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_provider); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "dependency_injector/containers.pyx":477 +/* "dependency_injector/containers.pyx":472 * return cls * * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< @@ -13906,17 +13887,17 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 472, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 472, __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, 477, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 472, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -13931,13 +13912,13 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 472, __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, 477, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(0, 472, __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 */ @@ -13965,19 +13946,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setattr__", 0); - /* "dependency_injector/containers.pyx":491 + /* "dependency_injector/containers.pyx":486 * :rtype: None * """ * if isinstance(value, providers.Provider) and name != '__self__': # <<<<<<<<<<<<<< * _check_provider_type(cls, value) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Provider); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Provider); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { @@ -13985,48 +13966,48 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_1 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_self, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_self, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 486, __pyx_L1_error) __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "dependency_injector/containers.pyx":492 + /* "dependency_injector/containers.pyx":487 * """ * if isinstance(value, providers.Provider) and name != '__self__': * _check_provider_type(cls, value) # <<<<<<<<<<<<<< * * if isinstance(value, providers.CHILD_PROVIDERS): */ - __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, 492, __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, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":494 + /* "dependency_injector/containers.pyx":489 * _check_provider_type(cls, value) * * if isinstance(value, providers.CHILD_PROVIDERS): # <<<<<<<<<<<<<< * value.assign_parent(cls) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CHILD_PROVIDERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CHILD_PROVIDERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { - /* "dependency_injector/containers.pyx":495 + /* "dependency_injector/containers.pyx":490 * * if isinstance(value, providers.CHILD_PROVIDERS): * value.assign_parent(cls) # <<<<<<<<<<<<<< * * cls.providers[name] = value */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_assign_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_assign_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -14040,12 +14021,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cls); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":494 + /* "dependency_injector/containers.pyx":489 * _check_provider_type(cls, value) * * if isinstance(value, providers.CHILD_PROVIDERS): # <<<<<<<<<<<<<< @@ -14054,31 +14035,31 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":497 + /* "dependency_injector/containers.pyx":492 * value.assign_parent(cls) * * cls.providers[name] = value # <<<<<<<<<<<<<< * cls.cls_providers[name] = value * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 497, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":498 + /* "dependency_injector/containers.pyx":493 * * cls.providers[name] = value * cls.cls_providers[name] = value # <<<<<<<<<<<<<< * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __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, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 498, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":491 + /* "dependency_injector/containers.pyx":486 * :rtype: None * """ * if isinstance(value, providers.Provider) and name != '__self__': # <<<<<<<<<<<<<< @@ -14087,16 +14068,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":499 + /* "dependency_injector/containers.pyx":494 * cls.providers[name] = value * cls.cls_providers[name] = value * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) # <<<<<<<<<<<<<< * * def __delattr__(cls, str name): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); @@ -14104,10 +14085,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_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -14125,7 +14106,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -14133,13 +14114,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -14150,14 +14131,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":477 + /* "dependency_injector/containers.pyx":472 * return cls * * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< @@ -14181,7 +14162,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":501 +/* "dependency_injector/containers.pyx":496 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * * def __delattr__(cls, str name): # <<<<<<<<<<<<<< @@ -14225,11 +14206,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, 1); __PYX_ERR(0, 501, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, 1); __PYX_ERR(0, 496, __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, 501, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__delattr__") < 0)) __PYX_ERR(0, 496, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14242,13 +14223,13 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 501, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 496, __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, 501, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(0, 496, __pyx_L1_error) __pyx_r = __pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_4__delattr__(__pyx_self, __pyx_v_cls, __pyx_v_name); /* function exit code */ @@ -14274,16 +14255,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__delattr__", 0); - /* "dependency_injector/containers.pyx":512 + /* "dependency_injector/containers.pyx":507 * :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, 512, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __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, 512, __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, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { @@ -14291,40 +14272,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, 512, __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, 507, __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, 512, __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, 507, __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":513 + /* "dependency_injector/containers.pyx":508 * """ * 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, 513, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 513, __pyx_L1_error) + if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":514 + /* "dependency_injector/containers.pyx":509 * 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, 514, __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, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":512 + /* "dependency_injector/containers.pyx":507 * :rtype: None * """ * if name in cls.providers and name in cls.cls_providers: # <<<<<<<<<<<<<< @@ -14333,16 +14314,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":515 + /* "dependency_injector/containers.pyx":510 * del cls.providers[name] * del cls.cls_providers[name] * super(DeclarativeContainerMetaClass, cls).__delattr__(name) # <<<<<<<<<<<<<< * * @property */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); @@ -14350,10 +14331,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, 515, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __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, 515, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_delattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -14368,12 +14349,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":501 + /* "dependency_injector/containers.pyx":496 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * * def __delattr__(cls, str name): # <<<<<<<<<<<<<< @@ -14396,7 +14377,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":518 +/* "dependency_injector/containers.pyx":513 * * @property * def dependencies(cls): # <<<<<<<<<<<<<< @@ -14420,8 +14401,8 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_6dependencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { - PyObject *__pyx_8genexpr6__pyx_v_name = NULL; - PyObject *__pyx_8genexpr6__pyx_v_provider = NULL; + PyObject *__pyx_8genexpr7__pyx_v_name = NULL; + PyObject *__pyx_8genexpr7__pyx_v_provider = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -14441,7 +14422,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dependencies", 0); - /* "dependency_injector/containers.pyx":527 + /* "dependency_injector/containers.pyx":522 * dict[str, :py:class:`dependency_injector.providers.Provider`] * """ * return { # <<<<<<<<<<<<<< @@ -14450,19 +14431,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":529 + /* "dependency_injector/containers.pyx":524 * return { * name: provider * for name, provider in cls.providers.items() # <<<<<<<<<<<<<< * if isinstance(provider, (providers.Dependency, providers.DependenciesContainer)) * } */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -14477,16 +14458,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L5_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14494,17 +14475,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 524, __pyx_L5_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 524, __pyx_L5_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -14514,7 +14495,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 529, __pyx_L5_error) + else __PYX_ERR(0, 524, __pyx_L5_error) } break; } @@ -14526,7 +14507,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 529, __pyx_L5_error) + __PYX_ERR(0, 524, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14539,15 +14520,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L5_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -14555,7 +14536,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 529, __pyx_L5_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 524, __pyx_L5_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_unpacking_done; @@ -14563,39 +14544,39 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 529, __pyx_L5_error) + __PYX_ERR(0, 524, __pyx_L5_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_name, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_provider, __pyx_t_7); + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_provider, __pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":530 + /* "dependency_injector/containers.pyx":525 * name: provider * for name, provider in cls.providers.items() * if isinstance(provider, (providers.Dependency, providers.DependenciesContainer)) # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L5_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Dependency); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 530, __pyx_L5_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Dependency); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L5_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DependenciesContainer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DependenciesContainer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = PyObject_IsInstance(__pyx_8genexpr6__pyx_v_provider, __pyx_t_7); + __pyx_t_11 = PyObject_IsInstance(__pyx_8genexpr7__pyx_v_provider, __pyx_t_7); __pyx_t_12 = (__pyx_t_11 != 0); if (!__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L11_bool_binop_done; } - __pyx_t_12 = PyObject_IsInstance(__pyx_8genexpr6__pyx_v_provider, __pyx_t_3); + __pyx_t_12 = PyObject_IsInstance(__pyx_8genexpr7__pyx_v_provider, __pyx_t_3); __pyx_t_11 = (__pyx_t_12 != 0); __pyx_t_10 = __pyx_t_11; __pyx_L11_bool_binop_done:; @@ -14604,16 +14585,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { - /* "dependency_injector/containers.pyx":528 + /* "dependency_injector/containers.pyx":523 * """ * return { * name: provider # <<<<<<<<<<<<<< * for name, provider in cls.providers.items() * if isinstance(provider, (providers.Dependency, providers.DependenciesContainer)) */ - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr6__pyx_v_name, (PyObject*)__pyx_8genexpr6__pyx_v_provider))) __PYX_ERR(0, 528, __pyx_L5_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr7__pyx_v_name, (PyObject*)__pyx_8genexpr7__pyx_v_provider))) __PYX_ERR(0, 523, __pyx_L5_error) - /* "dependency_injector/containers.pyx":530 + /* "dependency_injector/containers.pyx":525 * name: provider * for name, provider in cls.providers.items() * if isinstance(provider, (providers.Dependency, providers.DependenciesContainer)) # <<<<<<<<<<<<<< @@ -14622,7 +14603,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":529 + /* "dependency_injector/containers.pyx":524 * return { * name: provider * for name, provider in cls.providers.items() # <<<<<<<<<<<<<< @@ -14631,12 +14612,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_name); __pyx_8genexpr6__pyx_v_name = 0; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_provider); __pyx_8genexpr6__pyx_v_provider = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_name); __pyx_8genexpr7__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_provider); __pyx_8genexpr7__pyx_v_provider = 0; goto __pyx_L13_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_name); __pyx_8genexpr6__pyx_v_name = 0; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_provider); __pyx_8genexpr6__pyx_v_provider = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_name); __pyx_8genexpr7__pyx_v_name = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_provider); __pyx_8genexpr7__pyx_v_provider = 0; goto __pyx_L1_error; __pyx_L13_exit_scope:; } /* exit inner scope */ @@ -14644,7 +14625,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":518 + /* "dependency_injector/containers.pyx":513 * * @property * def dependencies(cls): # <<<<<<<<<<<<<< @@ -14663,15 +14644,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainerMetaClass.dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_name); - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_provider); + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_name); + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_provider); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_10generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dependency_injector/containers.pyx":533 +/* "dependency_injector/containers.pyx":528 * } * * def traverse(cls, types=None): # <<<<<<<<<<<<<< @@ -14720,7 +14701,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "traverse") < 0)) __PYX_ERR(0, 533, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "traverse") < 0)) __PYX_ERR(0, 528, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -14736,7 +14717,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("traverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 533, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("traverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 528, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainerMetaClass.traverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14750,18 +14731,18 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContainerMetaClass_8traverse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_types) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *__pyx_cur_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("traverse", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_traverse(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_7_traverse, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_traverse(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_8_traverse, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 533, __pyx_L1_error) + __PYX_ERR(0, 528, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -14772,7 +14753,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_cur_scope->__pyx_v_types); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_types); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_10generator1, __pyx_codeobj__20, (PyObject *) __pyx_cur_scope, __pyx_n_s_traverse, __pyx_n_s_DeclarativeContainerMetaClass_tr, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_10generator1, __pyx_codeobj__14, (PyObject *) __pyx_cur_scope, __pyx_n_s_traverse, __pyx_n_s_DeclarativeContainerMetaClass_tr, __pyx_n_s_dependency_injector_containers); if (unlikely(!gen)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14790,7 +14771,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContainerMetaClass_10generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *)__pyx_generator->closure); + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *__pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -14809,23 +14790,23 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 533, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 528, __pyx_L1_error) - /* "dependency_injector/containers.pyx":535 + /* "dependency_injector/containers.pyx":530 * def traverse(cls, types=None): * """Return providers traversal generator.""" * yield from providers.traverse(*cls.providers.values(), types=types) # <<<<<<<<<<<<<< * * def resolve_provider_name(cls, provider): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -14840,16 +14821,16 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_types, __pyx_cur_scope->__pyx_v_types) < 0) __PYX_ERR(0, 535, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_types, __pyx_cur_scope->__pyx_v_types) < 0) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -14865,17 +14846,17 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 535, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 530, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 535, __pyx_L1_error) + else __PYX_ERR(0, 530, __pyx_L1_error) } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dependency_injector/containers.pyx":533 + /* "dependency_injector/containers.pyx":528 * } * * def traverse(cls, types=None): # <<<<<<<<<<<<<< @@ -14903,7 +14884,7 @@ static PyObject *__pyx_gb_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":537 +/* "dependency_injector/containers.pyx":532 * yield from providers.traverse(*cls.providers.values(), types=types) * * def resolve_provider_name(cls, provider): # <<<<<<<<<<<<<< @@ -14947,11 +14928,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_provider)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, 1); __PYX_ERR(0, 537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, 1); __PYX_ERR(0, 532, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolve_provider_name") < 0)) __PYX_ERR(0, 537, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolve_provider_name") < 0)) __PYX_ERR(0, 532, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14964,7 +14945,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_29DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("resolve_provider_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 532, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainerMetaClass.resolve_provider_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14999,16 +14980,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resolve_provider_name", 0); - /* "dependency_injector/containers.pyx":539 + /* "dependency_injector/containers.pyx":534 * def resolve_provider_name(cls, provider): * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): # <<<<<<<<<<<<<< * if container_provider is provider: * return provider_name */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -15023,16 +15004,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -15040,17 +15021,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 534, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 534, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -15060,7 +15041,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 539, __pyx_L1_error) + else __PYX_ERR(0, 534, __pyx_L1_error) } break; } @@ -15072,7 +15053,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 539, __pyx_L1_error) + __PYX_ERR(0, 534, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -15085,15 +15066,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __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; @@ -15101,7 +15082,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 534, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -15109,7 +15090,7 @@ static PyObject *__pyx_pf_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, 539, __pyx_L1_error) + __PYX_ERR(0, 534, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_provider_name, __pyx_t_2); @@ -15117,7 +15098,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_container_provider, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":540 + /* "dependency_injector/containers.pyx":535 * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): * if container_provider is provider: # <<<<<<<<<<<<<< @@ -15128,7 +15109,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { - /* "dependency_injector/containers.pyx":541 + /* "dependency_injector/containers.pyx":536 * for provider_name, container_provider in cls.providers.items(): * if container_provider is provider: * return provider_name # <<<<<<<<<<<<<< @@ -15141,7 +15122,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":540 + /* "dependency_injector/containers.pyx":535 * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): * if container_provider is provider: # <<<<<<<<<<<<<< @@ -15150,7 +15131,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":539 + /* "dependency_injector/containers.pyx":534 * def resolve_provider_name(cls, provider): * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): # <<<<<<<<<<<<<< @@ -15160,19 +15141,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } /*else*/ { - /* "dependency_injector/containers.pyx":543 + /* "dependency_injector/containers.pyx":538 * return provider_name * else: * raise errors.Error(f'Can not resolve name for provider "{provider}"') # <<<<<<<<<<<<<< * * @property */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = 0; __pyx_t_12 = 127; @@ -15180,18 +15161,18 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_11 += 35; __Pyx_GIVEREF(__pyx_kp_u_Can_not_resolve_name_for_provide); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Can_not_resolve_name_for_provide); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_provider, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_provider, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12; __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); __pyx_t_7 = 0; - __Pyx_INCREF(__pyx_kp_u__17); + __Pyx_INCREF(__pyx_kp_u__11); __pyx_t_11 += 1; - __Pyx_GIVEREF(__pyx_kp_u__17); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__17); - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__11); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__11); + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -15207,15 +15188,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 543, __pyx_L1_error) + __PYX_ERR(0, 538, __pyx_L1_error) } - /* "dependency_injector/containers.pyx":539 + /* "dependency_injector/containers.pyx":534 * def resolve_provider_name(cls, provider): * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): # <<<<<<<<<<<<<< @@ -15224,7 +15205,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":537 + /* "dependency_injector/containers.pyx":532 * yield from providers.traverse(*cls.providers.values(), types=types) * * def resolve_provider_name(cls, provider): # <<<<<<<<<<<<<< @@ -15249,7 +15230,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":546 +/* "dependency_injector/containers.pyx":541 * * @property * def parent_name(cls): # <<<<<<<<<<<<<< @@ -15281,7 +15262,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parent_name", 0); - /* "dependency_injector/containers.pyx":548 + /* "dependency_injector/containers.pyx":543 * def parent_name(cls): * """Return parent name.""" * return cls.__name__ # <<<<<<<<<<<<<< @@ -15289,13 +15270,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai * @staticmethod */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":546 + /* "dependency_injector/containers.pyx":541 * * @property * def parent_name(cls): # <<<<<<<<<<<<<< @@ -15314,7 +15295,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":551 +/* "dependency_injector/containers.pyx":546 * * @staticmethod * def __fetch_self(attributes): # <<<<<<<<<<<<<< @@ -15360,7 +15341,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__fetch_self", 0); - /* "dependency_injector/containers.pyx":552 + /* "dependency_injector/containers.pyx":547 * @staticmethod * def __fetch_self(attributes): * self = None # <<<<<<<<<<<<<< @@ -15370,26 +15351,26 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(Py_None); __pyx_v_self = Py_None; - /* "dependency_injector/containers.pyx":553 + /* "dependency_injector/containers.pyx":548 * def __fetch_self(attributes): * self = None * alt_names = [] # <<<<<<<<<<<<<< * * for name, value in attributes.items(): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_alt_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":555 + /* "dependency_injector/containers.pyx":550 * alt_names = [] * * for name, value in attributes.items(): # <<<<<<<<<<<<<< * if not isinstance(value, providers.Self): * continue */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_attributes, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_attributes, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -15403,16 +15384,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -15420,17 +15401,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 550, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 550, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -15440,7 +15421,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 555, __pyx_L1_error) + else __PYX_ERR(0, 550, __pyx_L1_error) } break; } @@ -15452,7 +15433,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 555, __pyx_L1_error) + __PYX_ERR(0, 550, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -15465,15 +15446,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __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; @@ -15481,7 +15462,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 555, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 550, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -15489,7 +15470,7 @@ static PyObject *__pyx_pf_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, 555, __pyx_L1_error) + __PYX_ERR(0, 550, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); @@ -15497,24 +15478,24 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":556 + /* "dependency_injector/containers.pyx":551 * * for name, value in attributes.items(): * if not isinstance(value, providers.Self): # <<<<<<<<<<<<<< * continue * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = PyObject_IsInstance(__pyx_v_value, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_9 = PyObject_IsInstance(__pyx_v_value, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0); if (__pyx_t_10) { - /* "dependency_injector/containers.pyx":557 + /* "dependency_injector/containers.pyx":552 * for name, value in attributes.items(): * if not isinstance(value, providers.Self): * continue # <<<<<<<<<<<<<< @@ -15523,7 +15504,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ goto __pyx_L3_continue; - /* "dependency_injector/containers.pyx":556 + /* "dependency_injector/containers.pyx":551 * * for name, value in attributes.items(): * if not isinstance(value, providers.Self): # <<<<<<<<<<<<<< @@ -15532,7 +15513,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":559 + /* "dependency_injector/containers.pyx":554 * continue * * if self is not None and value is not self: # <<<<<<<<<<<<<< @@ -15552,16 +15533,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_10)) { - /* "dependency_injector/containers.pyx":560 + /* "dependency_injector/containers.pyx":555 * * if self is not None and value is not self: * raise errors.Error('Container can have only one "Self" provider') # <<<<<<<<<<<<<< * * if name != '__self__': */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -15576,14 +15557,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_kp_s_Container_can_have_only_one_Self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Container_can_have_only_one_Self); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 560, __pyx_L1_error) + __PYX_ERR(0, 555, __pyx_L1_error) - /* "dependency_injector/containers.pyx":559 + /* "dependency_injector/containers.pyx":554 * continue * * if self is not None and value is not self: # <<<<<<<<<<<<<< @@ -15592,26 +15573,26 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":562 + /* "dependency_injector/containers.pyx":557 * raise errors.Error('Container can have only one "Self" provider') * * if name != '__self__': # <<<<<<<<<<<<<< * alt_names.append(name) * */ - __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_self, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_self, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 557, __pyx_L1_error) if (__pyx_t_10) { - /* "dependency_injector/containers.pyx":563 + /* "dependency_injector/containers.pyx":558 * * if name != '__self__': * alt_names.append(name) # <<<<<<<<<<<<<< * * self = value */ - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_alt_names, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_alt_names, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 558, __pyx_L1_error) - /* "dependency_injector/containers.pyx":562 + /* "dependency_injector/containers.pyx":557 * raise errors.Error('Container can have only one "Self" provider') * * if name != '__self__': # <<<<<<<<<<<<<< @@ -15620,7 +15601,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":565 + /* "dependency_injector/containers.pyx":560 * alt_names.append(name) * * self = value # <<<<<<<<<<<<<< @@ -15630,7 +15611,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __Pyx_INCREF(__pyx_v_value); __Pyx_DECREF_SET(__pyx_v_self, __pyx_v_value); - /* "dependency_injector/containers.pyx":555 + /* "dependency_injector/containers.pyx":550 * alt_names = [] * * for name, value in attributes.items(): # <<<<<<<<<<<<<< @@ -15641,24 +15622,24 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":567 + /* "dependency_injector/containers.pyx":562 * self = value * * if self: # <<<<<<<<<<<<<< * self.set_alt_names(alt_names) * */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_self); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_self); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 562, __pyx_L1_error) if (__pyx_t_10) { - /* "dependency_injector/containers.pyx":568 + /* "dependency_injector/containers.pyx":563 * * if self: * self.set_alt_names(alt_names) # <<<<<<<<<<<<<< * * return self */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_alt_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_alt_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -15672,12 +15653,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_alt_names) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_alt_names); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":567 + /* "dependency_injector/containers.pyx":562 * self = value * * if self: # <<<<<<<<<<<<<< @@ -15686,7 +15667,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai */ } - /* "dependency_injector/containers.pyx":570 + /* "dependency_injector/containers.pyx":565 * self.set_alt_names(alt_names) * * return self # <<<<<<<<<<<<<< @@ -15698,7 +15679,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai __pyx_r = __pyx_v_self; goto __pyx_L0; - /* "dependency_injector/containers.pyx":551 + /* "dependency_injector/containers.pyx":546 * * @staticmethod * def __fetch_self(attributes): # <<<<<<<<<<<<<< @@ -15725,7 +15706,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_29DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":636 +/* "dependency_injector/containers.pyx":631 * """ * * def __new__(cls, **overriding_providers): # <<<<<<<<<<<<<< @@ -15767,7 +15748,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_overriding_providers, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 636, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_overriding_providers, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 631, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -15778,7 +15759,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 631, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_overriding_providers); __pyx_v_overriding_providers = 0; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainer.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -15815,14 +15796,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__new__", 0); - /* "dependency_injector/containers.pyx":642 + /* "dependency_injector/containers.pyx":637 * :rtype: :py:class:`DynamicContainer` * """ * container = cls.instance_type() # <<<<<<<<<<<<<< * container.provider_type = cls.provider_type * container.declarative_parent = cls */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_instance_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_instance_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -15836,63 +15817,63 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_container = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":643 + /* "dependency_injector/containers.pyx":638 * """ * container = cls.instance_type() * container.provider_type = cls.provider_type # <<<<<<<<<<<<<< * container.declarative_parent = cls * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_provider_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_provider_type, __pyx_t_1) < 0) __PYX_ERR(0, 643, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_provider_type, __pyx_t_1) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":644 + /* "dependency_injector/containers.pyx":639 * container = cls.instance_type() * container.provider_type = cls.provider_type * container.declarative_parent = cls # <<<<<<<<<<<<<< * * copied_providers = providers.deepcopy({ **cls.providers, **{'@@self@@': cls.__self__}}) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_declarative_parent, __pyx_v_cls) < 0) __PYX_ERR(0, 644, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_declarative_parent, __pyx_v_cls) < 0) __PYX_ERR(0, 639, __pyx_L1_error) - /* "dependency_injector/containers.pyx":646 + /* "dependency_injector/containers.pyx":641 * container.declarative_parent = cls * * copied_providers = providers.deepcopy({ **cls.providers, **{'@@self@@': cls.__self__}}) # <<<<<<<<<<<<<< * copied_self = copied_providers.pop('@@self@@') * copied_self.set_container(container) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 646, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_4))) { - __pyx_t_2 = PyDict_Copy(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = PyDict_Copy(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_self_3, __pyx_t_4) < 0) __PYX_ERR(0, 646, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_self_3, __pyx_t_4) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -15907,20 +15888,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_copied_providers = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":647 + /* "dependency_injector/containers.pyx":642 * * copied_providers = providers.deepcopy({ **cls.providers, **{'@@self@@': cls.__self__}}) * copied_self = copied_providers.pop('@@self@@') # <<<<<<<<<<<<<< * copied_self.set_container(container) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_providers, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_providers, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -15934,20 +15915,20 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_self_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_self_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_copied_self = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":648 + /* "dependency_injector/containers.pyx":643 * copied_providers = providers.deepcopy({ **cls.providers, **{'@@self@@': cls.__self__}}) * copied_self = copied_providers.pop('@@self@@') * copied_self.set_container(container) # <<<<<<<<<<<<<< * * container.__self__ = copied_self */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_self, __pyx_n_s_set_container); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_self, __pyx_n_s_set_container); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -15961,36 +15942,36 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_container) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_container); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":650 + /* "dependency_injector/containers.pyx":645 * copied_self.set_container(container) * * container.__self__ = copied_self # <<<<<<<<<<<<<< * for name in copied_self.alt_names: * container.set_provider(name, copied_self) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_self, __pyx_v_copied_self) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_container, __pyx_n_s_self, __pyx_v_copied_self) < 0) __PYX_ERR(0, 645, __pyx_L1_error) - /* "dependency_injector/containers.pyx":651 + /* "dependency_injector/containers.pyx":646 * * container.__self__ = copied_self * for name in copied_self.alt_names: # <<<<<<<<<<<<<< * container.set_provider(name, copied_self) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_self, __pyx_n_s_alt_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_self, __pyx_n_s_alt_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __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, 651, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -15998,17 +15979,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai 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, 651, __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, 646, __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, 651, __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, 646, __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, 651, __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, 646, __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, 651, __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, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -16018,7 +15999,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 651, __pyx_L1_error) + else __PYX_ERR(0, 646, __pyx_L1_error) } break; } @@ -16027,14 +16008,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":652 + /* "dependency_injector/containers.pyx":647 * container.__self__ = copied_self * for name in copied_self.alt_names: * container.set_provider(name, copied_self) # <<<<<<<<<<<<<< * * for name, provider in copied_providers.items(): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_set_provider); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_set_provider); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_7 = 0; @@ -16051,7 +16032,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_copied_self}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -16059,13 +16040,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_copied_self}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -16076,14 +16057,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_INCREF(__pyx_v_copied_self); __Pyx_GIVEREF(__pyx_v_copied_self); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_copied_self); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":651 + /* "dependency_injector/containers.pyx":646 * * container.__self__ = copied_self * for name in copied_self.alt_names: # <<<<<<<<<<<<<< @@ -16093,14 +16074,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":654 + /* "dependency_injector/containers.pyx":649 * container.set_provider(name, copied_self) * * for name, provider in copied_providers.items(): # <<<<<<<<<<<<<< * container.set_provider(name, provider) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_providers, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_providers, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -16114,16 +16095,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -16131,17 +16112,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 649, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 649, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -16151,7 +16132,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 654, __pyx_L1_error) + else __PYX_ERR(0, 649, __pyx_L1_error) } break; } @@ -16163,7 +16144,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, 654, __pyx_L1_error) + __PYX_ERR(0, 649, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16176,15 +16157,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -16192,7 +16173,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) __PYX_ERR(0, 649, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_unpacking_done; @@ -16200,7 +16181,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 649, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2); @@ -16208,14 +16189,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_8); __pyx_t_8 = 0; - /* "dependency_injector/containers.pyx":655 + /* "dependency_injector/containers.pyx":650 * * for name, provider in copied_providers.items(): * container.set_provider(name, provider) # <<<<<<<<<<<<<< * * container.override_providers(**overriding_providers) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_set_provider); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_set_provider); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = NULL; __pyx_t_7 = 0; @@ -16232,7 +16213,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_provider}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -16240,13 +16221,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_provider}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -16257,14 +16238,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_INCREF(__pyx_v_provider); __Pyx_GIVEREF(__pyx_v_provider); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_provider); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":654 + /* "dependency_injector/containers.pyx":649 * container.set_provider(name, copied_self) * * for name, provider in copied_providers.items(): # <<<<<<<<<<<<<< @@ -16274,28 +16255,28 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":657 + /* "dependency_injector/containers.pyx":652 * container.set_provider(name, provider) * * container.override_providers(**overriding_providers) # <<<<<<<<<<<<<< * container.apply_container_providers_overridings() * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_override_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_override_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_overriding_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_overriding_providers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":658 + /* "dependency_injector/containers.pyx":653 * * container.override_providers(**overriding_providers) * container.apply_container_providers_overridings() # <<<<<<<<<<<<<< * * return container */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_apply_container_providers_overri); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_apply_container_providers_overri); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -16309,12 +16290,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":660 + /* "dependency_injector/containers.pyx":655 * container.apply_container_providers_overridings() * * return container # <<<<<<<<<<<<<< @@ -16326,7 +16307,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_r = __pyx_v_container; goto __pyx_L0; - /* "dependency_injector/containers.pyx":636 + /* "dependency_injector/containers.pyx":631 * """ * * def __new__(cls, **overriding_providers): # <<<<<<<<<<<<<< @@ -16354,7 +16335,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":663 +/* "dependency_injector/containers.pyx":658 * * @classmethod * def override(cls, object overriding): # <<<<<<<<<<<<<< @@ -16398,11 +16379,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_20DeclarativeContai case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overriding)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, 1); __PYX_ERR(0, 663, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, 1); __PYX_ERR(0, 658, __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, 663, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "override") < 0)) __PYX_ERR(0, 658, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -16415,7 +16396,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, 663, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("override", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 658, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.DeclarativeContainer.override", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16452,38 +16433,38 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("override", 0); - /* "dependency_injector/containers.pyx":674 + /* "dependency_injector/containers.pyx":669 * :rtype: None * """ * if issubclass(cls, overriding): # <<<<<<<<<<<<<< * raise errors.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 == ((int)-1))) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_1 = PyObject_IsSubclass(__pyx_v_cls, __pyx_v_overriding); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 669, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "dependency_injector/containers.pyx":675 + /* "dependency_injector/containers.pyx":670 * """ * if issubclass(cls, overriding): * raise errors.Error('Container {0} could not be overridden ' # <<<<<<<<<<<<<< * 'with itself or its subclasses'.format(cls)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":676 + /* "dependency_injector/containers.pyx":671 * if issubclass(cls, overriding): * raise errors.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, 676, __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, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -16497,7 +16478,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cls); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -16513,14 +16494,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 675, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) - /* "dependency_injector/containers.pyx":674 + /* "dependency_injector/containers.pyx":669 * :rtype: None * """ * if issubclass(cls, overriding): # <<<<<<<<<<<<<< @@ -16529,40 +16510,40 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai */ } - /* "dependency_injector/containers.pyx":678 + /* "dependency_injector/containers.pyx":673 * '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, 678, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_overriding); __Pyx_GIVEREF(__pyx_v_overriding); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_overriding); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_4) < 0) __PYX_ERR(0, 678, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_4) < 0) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":680 + /* "dependency_injector/containers.pyx":675 * cls.overridden += (overriding,) * * for name, provider in six.iteritems(overriding.cls_providers): # <<<<<<<<<<<<<< * try: * getattr(cls, name).override(provider) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_overriding, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_overriding, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -16577,16 +16558,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 675, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -16594,17 +16575,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 675, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 675, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -16614,7 +16595,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 680, __pyx_L1_error) + else __PYX_ERR(0, 675, __pyx_L1_error) } break; } @@ -16626,7 +16607,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, 680, __pyx_L1_error) + __PYX_ERR(0, 675, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16639,15 +16620,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -16655,7 +16636,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_7), 2) < 0) __PYX_ERR(0, 680, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_7), 2) < 0) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; @@ -16663,7 +16644,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 680, __pyx_L1_error) + __PYX_ERR(0, 675, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); @@ -16671,7 +16652,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":681 + /* "dependency_injector/containers.pyx":676 * * for name, provider in six.iteritems(overriding.cls_providers): * try: # <<<<<<<<<<<<<< @@ -16687,16 +16668,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { - /* "dependency_injector/containers.pyx":682 + /* "dependency_injector/containers.pyx":677 * for name, provider in six.iteritems(overriding.cls_providers): * try: * getattr(cls, name).override(provider) # <<<<<<<<<<<<<< * except AttributeError: * pass */ - __pyx_t_6 = __Pyx_GetAttr(__pyx_v_cls, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L8_error) + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_cls, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_override); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L8_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_override); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -16711,12 +16692,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_provider) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_provider); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L8_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":681 + /* "dependency_injector/containers.pyx":676 * * for name, provider in six.iteritems(overriding.cls_providers): * try: # <<<<<<<<<<<<<< @@ -16734,7 +16715,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":683 + /* "dependency_injector/containers.pyx":678 * try: * getattr(cls, name).override(provider) * except AttributeError: # <<<<<<<<<<<<<< @@ -16749,7 +16730,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai goto __pyx_L10_except_error; __pyx_L10_except_error:; - /* "dependency_injector/containers.pyx":681 + /* "dependency_injector/containers.pyx":676 * * for name, provider in six.iteritems(overriding.cls_providers): * try: # <<<<<<<<<<<<<< @@ -16769,7 +16750,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_L15_try_end:; } - /* "dependency_injector/containers.pyx":680 + /* "dependency_injector/containers.pyx":675 * cls.overridden += (overriding,) * * for name, provider in six.iteritems(overriding.cls_providers): # <<<<<<<<<<<<<< @@ -16779,7 +16760,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":663 + /* "dependency_injector/containers.pyx":658 * * @classmethod * def override(cls, object overriding): # <<<<<<<<<<<<<< @@ -16806,7 +16787,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":687 +/* "dependency_injector/containers.pyx":682 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< @@ -16847,33 +16828,33 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset_last_overriding", 0); - /* "dependency_injector/containers.pyx":692 + /* "dependency_injector/containers.pyx":687 * :rtype: None * """ * if not cls.overridden: # <<<<<<<<<<<<<< * raise errors.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, 692, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __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, 692, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (unlikely(__pyx_t_3)) { - /* "dependency_injector/containers.pyx":693 + /* "dependency_injector/containers.pyx":688 * """ * if not cls.overridden: * raise errors.Error('Container {0} is not overridden'.format(cls)) # <<<<<<<<<<<<<< * * cls.overridden = cls.overridden[:-1] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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, 693, __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, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -16887,7 +16868,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cls); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -16903,14 +16884,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 693, __pyx_L1_error) + __PYX_ERR(0, 688, __pyx_L1_error) - /* "dependency_injector/containers.pyx":692 + /* "dependency_injector/containers.pyx":687 * :rtype: None * """ * if not cls.overridden: # <<<<<<<<<<<<<< @@ -16919,34 +16900,34 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai */ } - /* "dependency_injector/containers.pyx":695 + /* "dependency_injector/containers.pyx":690 * raise errors.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, 695, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_5) < 0) __PYX_ERR(0, 695, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_5) < 0) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/containers.pyx":697 + /* "dependency_injector/containers.pyx":692 * cls.overridden = cls.overridden[:-1] * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * provider.reset_last_overriding() * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -16961,16 +16942,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 692, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -16978,17 +16959,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 692, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 692, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -16998,7 +16979,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 697, __pyx_L1_error) + else __PYX_ERR(0, 692, __pyx_L1_error) } break; } @@ -17007,14 +16988,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/containers.pyx":698 + /* "dependency_injector/containers.pyx":693 * * for provider in six.itervalues(cls.providers): * provider.reset_last_overriding() # <<<<<<<<<<<<<< * * @classmethod */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_last_overriding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_last_overriding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -17028,12 +17009,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dependency_injector/containers.pyx":697 + /* "dependency_injector/containers.pyx":692 * cls.overridden = cls.overridden[:-1] * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< @@ -17043,7 +17024,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":687 + /* "dependency_injector/containers.pyx":682 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< @@ -17069,7 +17050,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":701 +/* "dependency_injector/containers.pyx":696 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< @@ -17107,31 +17088,31 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset_override", 0); - /* "dependency_injector/containers.pyx":706 + /* "dependency_injector/containers.pyx":701 * :rtype: None * """ * cls.overridden = tuple() # <<<<<<<<<<<<<< * * for provider in six.itervalues(cls.providers): */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __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, 706, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_overridden, __pyx_t_1) < 0) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":708 + /* "dependency_injector/containers.pyx":703 * cls.overridden = tuple() * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< * provider.reset_override() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __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, 708, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __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, 708, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -17146,16 +17127,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __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, 708, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -17163,17 +17144,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai 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, 708, __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, 703, __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, 708, __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, 703, __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, 708, __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, 703, __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, 708, __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, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -17183,7 +17164,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 708, __pyx_L1_error) + else __PYX_ERR(0, 703, __pyx_L1_error) } break; } @@ -17192,14 +17173,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":709 + /* "dependency_injector/containers.pyx":704 * * for provider in six.itervalues(cls.providers): * provider.reset_override() # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_reset_override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -17213,12 +17194,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":708 + /* "dependency_injector/containers.pyx":703 * cls.overridden = tuple() * * for provider in six.itervalues(cls.providers): # <<<<<<<<<<<<<< @@ -17228,7 +17209,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":701 + /* "dependency_injector/containers.pyx":696 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< @@ -17253,7 +17234,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_20DeclarativeContai return __pyx_r; } -/* "dependency_injector/containers.pyx":714 +/* "dependency_injector/containers.pyx":709 * class SingletonResetContext: * * def __init__(self, container): # <<<<<<<<<<<<<< @@ -17296,11 +17277,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_21SingletonResetCon case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_container)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 714, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 709, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 714, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 709, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -17313,7 +17294,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_21SingletonResetCon } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 714, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 709, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.SingletonResetContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17334,16 +17315,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "dependency_injector/containers.pyx":715 + /* "dependency_injector/containers.pyx":710 * * def __init__(self, container): * self._container = container # <<<<<<<<<<<<<< * * def __enter__(self): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_container_2, __pyx_v_container) < 0) __PYX_ERR(0, 715, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_container_2, __pyx_v_container) < 0) __PYX_ERR(0, 710, __pyx_L1_error) - /* "dependency_injector/containers.pyx":714 + /* "dependency_injector/containers.pyx":709 * class SingletonResetContext: * * def __init__(self, container): # <<<<<<<<<<<<<< @@ -17363,7 +17344,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon return __pyx_r; } -/* "dependency_injector/containers.pyx":717 +/* "dependency_injector/containers.pyx":712 * self._container = container * * def __enter__(self): # <<<<<<<<<<<<<< @@ -17394,7 +17375,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); - /* "dependency_injector/containers.pyx":718 + /* "dependency_injector/containers.pyx":713 * * def __enter__(self): * return self._container # <<<<<<<<<<<<<< @@ -17402,13 +17383,13 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon * def __exit__(self, *_): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_container_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_container_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dependency_injector/containers.pyx":717 + /* "dependency_injector/containers.pyx":712 * self._container = container * * def __enter__(self): # <<<<<<<<<<<<<< @@ -17427,7 +17408,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon return __pyx_r; } -/* "dependency_injector/containers.pyx":720 +/* "dependency_injector/containers.pyx":715 * return self._container * * def __exit__(self, *_): # <<<<<<<<<<<<<< @@ -17477,7 +17458,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_21SingletonResetCon } 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, 0, values, used_pos_args, "__exit__") < 0)) __PYX_ERR(0, 720, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__exit__") < 0)) __PYX_ERR(0, 715, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -17488,7 +17469,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_21SingletonResetCon } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__exit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__exit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 715, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v__); __pyx_v__ = 0; __Pyx_AddTraceback("dependency_injector.containers.SingletonResetContext.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -17514,16 +17495,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); - /* "dependency_injector/containers.pyx":721 + /* "dependency_injector/containers.pyx":716 * * def __exit__(self, *_): * self._container.reset_singletons() # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_container_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_container_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reset_singletons); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reset_singletons); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -17538,12 +17519,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":720 + /* "dependency_injector/containers.pyx":715 * return self._container * * def __exit__(self, *_): # <<<<<<<<<<<<<< @@ -17566,7 +17547,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_21SingletonResetCon return __pyx_r; } -/* "dependency_injector/containers.pyx":724 +/* "dependency_injector/containers.pyx":719 * * * def override(object container): # <<<<<<<<<<<<<< @@ -17589,7 +17570,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_5override(PyObject return __pyx_r; } -/* "dependency_injector/containers.pyx":734 +/* "dependency_injector/containers.pyx":729 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(object overriding_container): # <<<<<<<<<<<<<< @@ -17613,8 +17594,8 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_8override_1_decorat } static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorator(PyObject *__pyx_self, PyObject *__pyx_v_overriding_container) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *__pyx_cur_scope; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *__pyx_outer_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *__pyx_cur_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17624,18 +17605,18 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decorator", 0); - __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "dependency_injector/containers.pyx":736 + /* "dependency_injector/containers.pyx":731 * 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, 736, __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, 736, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 731, __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, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -17649,12 +17630,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_overriding_container) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_overriding_container); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":737 + /* "dependency_injector/containers.pyx":732 * """Overriding decorator.""" * container.override(overriding_container) * return overriding_container # <<<<<<<<<<<<<< @@ -17666,7 +17647,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato __pyx_r = __pyx_v_overriding_container; goto __pyx_L0; - /* "dependency_injector/containers.pyx":734 + /* "dependency_injector/containers.pyx":729 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(object overriding_container): # <<<<<<<<<<<<<< @@ -17687,7 +17668,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato return __pyx_r; } -/* "dependency_injector/containers.pyx":724 +/* "dependency_injector/containers.pyx":719 * * * def override(object container): # <<<<<<<<<<<<<< @@ -17696,7 +17677,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8override__decorato */ static PyObject *__pyx_pf_19dependency_injector_10containers_4override(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_container) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *__pyx_cur_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *__pyx_cur_scope; PyObject *__pyx_v__decorator = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -17705,11 +17686,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4override(CYTHON_UN const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("override", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_override(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_8_override, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_override(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_9_override, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 724, __pyx_L1_error) + __PYX_ERR(0, 719, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -17717,19 +17698,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4override(CYTHON_UN __Pyx_INCREF(__pyx_cur_scope->__pyx_v_container); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_container); - /* "dependency_injector/containers.pyx":734 + /* "dependency_injector/containers.pyx":729 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(object overriding_container): # <<<<<<<<<<<<<< * """Overriding decorator.""" * container.override(overriding_container) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__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__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__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__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__decorator = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":738 + /* "dependency_injector/containers.pyx":733 * container.override(overriding_container) * return overriding_container * return _decorator # <<<<<<<<<<<<<< @@ -17741,7 +17722,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4override(CYTHON_UN __pyx_r = __pyx_v__decorator; goto __pyx_L0; - /* "dependency_injector/containers.pyx":724 + /* "dependency_injector/containers.pyx":719 * * * def override(object container): # <<<<<<<<<<<<<< @@ -17762,7 +17743,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4override(CYTHON_UN return __pyx_r; } -/* "dependency_injector/containers.pyx":741 +/* "dependency_injector/containers.pyx":736 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -17785,7 +17766,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_7copy(PyObject *__p return __pyx_r; } -/* "dependency_injector/containers.pyx":754 +/* "dependency_injector/containers.pyx":749 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _get_providers_memo(from_providers, source_providers): # <<<<<<<<<<<<<< @@ -17828,11 +17809,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_4copy_1_get_provide case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_providers)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_get_providers_memo", 1, 2, 2, 1); __PYX_ERR(0, 754, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_providers_memo", 1, 2, 2, 1); __PYX_ERR(0, 749, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_providers_memo") < 0)) __PYX_ERR(0, 754, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_providers_memo") < 0)) __PYX_ERR(0, 749, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -17845,7 +17826,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_4copy_1_get_provide } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_providers_memo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 754, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_providers_memo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 749, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers.copy._get_providers_memo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17859,8 +17840,8 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_4copy_1_get_provide } static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_providers_memo(PyObject *__pyx_self, PyObject *__pyx_v_from_providers, PyObject *__pyx_v_source_providers) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *__pyx_cur_scope; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *__pyx_outer_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *__pyx_cur_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *__pyx_outer_scope; PyObject *__pyx_v_memo = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_provider = NULL; @@ -17887,29 +17868,29 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_providers_memo", 0); - __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "dependency_injector/containers.pyx":755 + /* "dependency_injector/containers.pyx":750 * """ * def _get_providers_memo(from_providers, source_providers): * memo = dict() # <<<<<<<<<<<<<< * * for name, provider in from_providers.items(): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_memo = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":757 + /* "dependency_injector/containers.pyx":752 * memo = dict() * * for name, provider in from_providers.items(): # <<<<<<<<<<<<<< * try: * source_provider = source_providers[name] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_from_providers, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_from_providers, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -17923,16 +17904,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -17940,17 +17921,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -17960,7 +17941,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 757, __pyx_L1_error) + else __PYX_ERR(0, 752, __pyx_L1_error) } break; } @@ -17972,7 +17953,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 757, __pyx_L1_error) + __PYX_ERR(0, 752, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -17985,15 +17966,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __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; @@ -18001,7 +17982,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 752, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -18009,7 +17990,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 757, __pyx_L1_error) + __PYX_ERR(0, 752, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); @@ -18017,7 +17998,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":758 + /* "dependency_injector/containers.pyx":753 * * for name, provider in from_providers.items(): * try: # <<<<<<<<<<<<<< @@ -18033,19 +18014,19 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { - /* "dependency_injector/containers.pyx":759 + /* "dependency_injector/containers.pyx":754 * for name, provider in from_providers.items(): * try: * source_provider = source_providers[name] # <<<<<<<<<<<<<< * except KeyError: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_source_providers, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L7_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_source_providers, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_source_provider, __pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":758 + /* "dependency_injector/containers.pyx":753 * * for name, provider in from_providers.items(): * try: # <<<<<<<<<<<<<< @@ -18054,7 +18035,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider */ } - /* "dependency_injector/containers.pyx":763 + /* "dependency_injector/containers.pyx":758 * continue * else: * memo[id(source_provider)] = provider # <<<<<<<<<<<<<< @@ -18062,62 +18043,62 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider * if hasattr(provider, 'providers') and hasattr(source_provider, 'providers'): */ /*else:*/ { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_source_provider); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L9_except_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_source_provider); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_memo, __pyx_t_1, __pyx_v_provider) < 0)) __PYX_ERR(0, 763, __pyx_L9_except_error) + if (unlikely(PyDict_SetItem(__pyx_v_memo, __pyx_t_1, __pyx_v_provider) < 0)) __PYX_ERR(0, 758, __pyx_L9_except_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":765 + /* "dependency_injector/containers.pyx":760 * memo[id(source_provider)] = provider * * if hasattr(provider, 'providers') and hasattr(source_provider, 'providers'): # <<<<<<<<<<<<<< * sub_memo = _get_providers_memo(provider.providers, source_provider.providers) * memo.update(sub_memo) */ - __pyx_t_13 = __Pyx_HasAttr(__pyx_v_provider, __pyx_n_s_providers); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 765, __pyx_L9_except_error) + __pyx_t_13 = __Pyx_HasAttr(__pyx_v_provider, __pyx_n_s_providers); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 760, __pyx_L9_except_error) __pyx_t_14 = (__pyx_t_13 != 0); if (__pyx_t_14) { } else { __pyx_t_12 = __pyx_t_14; goto __pyx_L16_bool_binop_done; } - __pyx_t_14 = __Pyx_HasAttr(__pyx_v_source_provider, __pyx_n_s_providers); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 765, __pyx_L9_except_error) + __pyx_t_14 = __Pyx_HasAttr(__pyx_v_source_provider, __pyx_n_s_providers); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 760, __pyx_L9_except_error) __pyx_t_13 = (__pyx_t_14 != 0); __pyx_t_12 = __pyx_t_13; __pyx_L16_bool_binop_done:; if (__pyx_t_12) { - /* "dependency_injector/containers.pyx":766 + /* "dependency_injector/containers.pyx":761 * * if hasattr(provider, 'providers') and hasattr(source_provider, 'providers'): * sub_memo = _get_providers_memo(provider.providers, source_provider.providers) # <<<<<<<<<<<<<< * memo.update(sub_memo) * return memo */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L9_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_source_provider, __pyx_n_s_providers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 766, __pyx_L9_except_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_source_provider, __pyx_n_s_providers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 761, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(!__pyx_cur_scope->__pyx_v__get_providers_memo)) { __Pyx_RaiseClosureNameError("_get_providers_memo"); __PYX_ERR(0, 766, __pyx_L9_except_error) } - __pyx_t_3 = __pyx_pf_19dependency_injector_10containers_4copy__get_providers_memo(__pyx_cur_scope->__pyx_v__get_providers_memo, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L9_except_error) + if (unlikely(!__pyx_cur_scope->__pyx_v__get_providers_memo)) { __Pyx_RaiseClosureNameError("_get_providers_memo"); __PYX_ERR(0, 761, __pyx_L9_except_error) } + __pyx_t_3 = __pyx_pf_19dependency_injector_10containers_4copy__get_providers_memo(__pyx_cur_scope->__pyx_v__get_providers_memo, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_sub_memo, __pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":767 + /* "dependency_injector/containers.pyx":762 * if hasattr(provider, 'providers') and hasattr(source_provider, 'providers'): * sub_memo = _get_providers_memo(provider.providers, source_provider.providers) * memo.update(sub_memo) # <<<<<<<<<<<<<< * return memo * */ - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_memo, __pyx_v_sub_memo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L9_except_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_memo, __pyx_v_sub_memo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":765 + /* "dependency_injector/containers.pyx":760 * memo[id(source_provider)] = provider * * if hasattr(provider, 'providers') and hasattr(source_provider, 'providers'): # <<<<<<<<<<<<<< @@ -18136,7 +18117,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dependency_injector/containers.pyx":760 + /* "dependency_injector/containers.pyx":755 * try: * source_provider = source_providers[name] * except KeyError: # <<<<<<<<<<<<<< @@ -18146,12 +18127,12 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_15) { __Pyx_AddTraceback("dependency_injector.containers.copy._get_providers_memo", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 760, __pyx_L9_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 755, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); - /* "dependency_injector/containers.pyx":761 + /* "dependency_injector/containers.pyx":756 * source_provider = source_providers[name] * except KeyError: * continue # <<<<<<<<<<<<<< @@ -18168,7 +18149,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider goto __pyx_L9_except_error; __pyx_L9_except_error:; - /* "dependency_injector/containers.pyx":758 + /* "dependency_injector/containers.pyx":753 * * for name, provider in from_providers.items(): * try: # <<<<<<<<<<<<<< @@ -18189,7 +18170,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __pyx_L14_try_end:; } - /* "dependency_injector/containers.pyx":757 + /* "dependency_injector/containers.pyx":752 * memo = dict() * * for name, provider in from_providers.items(): # <<<<<<<<<<<<<< @@ -18200,7 +18181,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":768 + /* "dependency_injector/containers.pyx":763 * sub_memo = _get_providers_memo(provider.providers, source_provider.providers) * memo.update(sub_memo) * return memo # <<<<<<<<<<<<<< @@ -18212,7 +18193,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider __pyx_r = __pyx_v_memo; goto __pyx_L0; - /* "dependency_injector/containers.pyx":754 + /* "dependency_injector/containers.pyx":749 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _get_providers_memo(from_providers, source_providers): # <<<<<<<<<<<<<< @@ -18240,7 +18221,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy__get_provider return __pyx_r; } -/* "dependency_injector/containers.pyx":770 +/* "dependency_injector/containers.pyx":765 * return memo * * def _decorator(copied_container): # <<<<<<<<<<<<<< @@ -18263,8 +18244,8 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_4copy_3_decorator(P } static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(PyObject *__pyx_self, PyObject *__pyx_v_copied_container) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *__pyx_cur_scope; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *__pyx_outer_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *__pyx_cur_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *__pyx_outer_scope; PyObject *__pyx_v_memo = NULL; PyObject *__pyx_v_providers_copy = NULL; PyObject *__pyx_v_name = NULL; @@ -18285,43 +18266,43 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decorator", 0); - __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "dependency_injector/containers.pyx":771 + /* "dependency_injector/containers.pyx":766 * * def _decorator(copied_container): * memo = _get_providers_memo(copied_container.cls_providers, container.providers) # <<<<<<<<<<<<<< * * providers_copy = providers.deepcopy(container.providers, memo) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_container, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied_container, __pyx_n_s_cls_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 771, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 766, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v__get_providers_memo)) { __Pyx_RaiseClosureNameError("_get_providers_memo"); __PYX_ERR(0, 771, __pyx_L1_error) } - __pyx_t_3 = __pyx_pf_19dependency_injector_10containers_4copy__get_providers_memo(__pyx_cur_scope->__pyx_v__get_providers_memo, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v__get_providers_memo)) { __Pyx_RaiseClosureNameError("_get_providers_memo"); __PYX_ERR(0, 766, __pyx_L1_error) } + __pyx_t_3 = __pyx_pf_19dependency_injector_10containers_4copy__get_providers_memo(__pyx_cur_scope->__pyx_v__get_providers_memo, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_memo = __pyx_t_3; __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":773 + /* "dependency_injector/containers.pyx":768 * memo = _get_providers_memo(copied_container.cls_providers, container.providers) * * providers_copy = providers.deepcopy(container.providers, memo) # <<<<<<<<<<<<<< * for name, provider in six.iteritems(providers_copy): * setattr(copied_container, name, provider) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 773, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_container)) { __Pyx_RaiseClosureNameError("container"); __PYX_ERR(0, 768, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_container, __pyx_n_s_providers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18338,7 +18319,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_memo}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18347,14 +18328,14 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_memo}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -18365,7 +18346,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __Pyx_GIVEREF(__pyx_v_memo); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_memo); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -18373,16 +18354,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __pyx_v_providers_copy = __pyx_t_3; __pyx_t_3 = 0; - /* "dependency_injector/containers.pyx":774 + /* "dependency_injector/containers.pyx":769 * * providers_copy = providers.deepcopy(container.providers, memo) * for name, provider in six.iteritems(providers_copy): # <<<<<<<<<<<<<< * setattr(copied_container, name, provider) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -18397,16 +18378,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_providers_copy) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_providers_copy); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 769, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -18414,17 +18395,17 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 769, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 769, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -18434,7 +18415,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 774, __pyx_L1_error) + else __PYX_ERR(0, 769, __pyx_L1_error) } break; } @@ -18446,7 +18427,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 774, __pyx_L1_error) + __PYX_ERR(0, 769, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -18459,15 +18440,15 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -18475,7 +18456,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) __PYX_ERR(0, 774, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) __PYX_ERR(0, 769, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_unpacking_done; @@ -18483,7 +18464,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 774, __pyx_L1_error) + __PYX_ERR(0, 769, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); @@ -18491,16 +18472,16 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __Pyx_XDECREF_SET(__pyx_v_provider, __pyx_t_2); __pyx_t_2 = 0; - /* "dependency_injector/containers.pyx":775 + /* "dependency_injector/containers.pyx":770 * providers_copy = providers.deepcopy(container.providers, memo) * for name, provider in six.iteritems(providers_copy): * setattr(copied_container, name, provider) # <<<<<<<<<<<<<< * * return copied_container */ - __pyx_t_10 = PyObject_SetAttr(__pyx_v_copied_container, __pyx_v_name, __pyx_v_provider); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_10 = PyObject_SetAttr(__pyx_v_copied_container, __pyx_v_name, __pyx_v_provider); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 770, __pyx_L1_error) - /* "dependency_injector/containers.pyx":774 + /* "dependency_injector/containers.pyx":769 * * providers_copy = providers.deepcopy(container.providers, memo) * for name, provider in six.iteritems(providers_copy): # <<<<<<<<<<<<<< @@ -18510,7 +18491,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":777 + /* "dependency_injector/containers.pyx":772 * setattr(copied_container, name, provider) * * return copied_container # <<<<<<<<<<<<<< @@ -18522,7 +18503,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P __pyx_r = __pyx_v_copied_container; goto __pyx_L0; - /* "dependency_injector/containers.pyx":770 + /* "dependency_injector/containers.pyx":765 * return memo * * def _decorator(copied_container): # <<<<<<<<<<<<<< @@ -18549,7 +18530,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P return __pyx_r; } -/* "dependency_injector/containers.pyx":741 +/* "dependency_injector/containers.pyx":736 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -18558,7 +18539,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_4copy_2_decorator(P */ static PyObject *__pyx_pf_19dependency_injector_10containers_6copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_container) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *__pyx_cur_scope; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *__pyx_cur_scope; PyObject *__pyx_v__decorator = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -18567,11 +18548,11 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_6copy(CYTHON_UNUSED const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); - __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_copy(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_9_copy, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *)__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_10_copy(__pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_10_copy, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 741, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -18579,32 +18560,32 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_6copy(CYTHON_UNUSED __Pyx_INCREF(__pyx_cur_scope->__pyx_v_container); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_container); - /* "dependency_injector/containers.pyx":754 + /* "dependency_injector/containers.pyx":749 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _get_providers_memo(from_providers, source_providers): # <<<<<<<<<<<<<< * memo = dict() * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_4copy_1_get_providers_memo, 0, __pyx_n_s_copy_locals__get_providers_memo, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_4copy_1_get_providers_memo, 0, __pyx_n_s_copy_locals__get_providers_memo, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v__get_providers_memo = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":770 + /* "dependency_injector/containers.pyx":765 * return memo * * def _decorator(copied_container): # <<<<<<<<<<<<<< * memo = _get_providers_memo(copied_container.cls_providers, container.providers) * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_4copy_3_decorator, 0, __pyx_n_s_copy_locals__decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_4copy_3_decorator, 0, __pyx_n_s_copy_locals__decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__decorator = __pyx_t_1; __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":778 + /* "dependency_injector/containers.pyx":773 * * return copied_container * return _decorator # <<<<<<<<<<<<<< @@ -18616,7 +18597,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_6copy(CYTHON_UNUSED __pyx_r = __pyx_v__decorator; goto __pyx_L0; - /* "dependency_injector/containers.pyx":741 + /* "dependency_injector/containers.pyx":736 * * * def copy(object container): # <<<<<<<<<<<<<< @@ -18637,7 +18618,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_6copy(CYTHON_UNUSED return __pyx_r; } -/* "dependency_injector/containers.pyx":781 +/* "dependency_injector/containers.pyx":776 * * * cpdef bint is_container(object instance): # <<<<<<<<<<<<<< @@ -18656,21 +18637,21 @@ static int __pyx_f_19dependency_injector_10containers_is_container(PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_container", 0); - /* "dependency_injector/containers.pyx":789 + /* "dependency_injector/containers.pyx":784 * :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, 789, __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, 784, __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":781 + /* "dependency_injector/containers.pyx":776 * * * cpdef bint is_container(object instance): # <<<<<<<<<<<<<< @@ -18711,7 +18692,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8is_container(CYTHO int __pyx_clineno = 0; __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, 781, __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, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18728,7 +18709,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_8is_container(CYTHO return __pyx_r; } -/* "dependency_injector/containers.pyx":792 +/* "dependency_injector/containers.pyx":787 * * * cpdef object _check_provider_type(object container, object provider): # <<<<<<<<<<<<<< @@ -18755,40 +18736,40 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_provider_type", 0); - /* "dependency_injector/containers.pyx":793 + /* "dependency_injector/containers.pyx":788 * * cpdef object _check_provider_type(object container, object provider): * if not isinstance(provider, container.provider_type): # <<<<<<<<<<<<<< * raise errors.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, 793, __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, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_provider, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_provider, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (unlikely(__pyx_t_3)) { - /* "dependency_injector/containers.pyx":794 + /* "dependency_injector/containers.pyx":789 * cpdef object _check_provider_type(object container, object provider): * if not isinstance(provider, container.provider_type): * raise errors.Error('{0} can contain only {1} ' # <<<<<<<<<<<<<< * 'instances'.format(container, container.provider_type)) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dependency_injector/containers.pyx":795 + /* "dependency_injector/containers.pyx":790 * if not isinstance(provider, container.provider_type): * raise errors.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, 795, __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, 790, __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, 795, __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, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -18805,7 +18786,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_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -18814,14 +18795,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_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __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, 795, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __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; @@ -18832,7 +18813,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_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -18850,14 +18831,14 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 794, __pyx_L1_error) + __PYX_ERR(0, 789, __pyx_L1_error) - /* "dependency_injector/containers.pyx":793 + /* "dependency_injector/containers.pyx":788 * * cpdef object _check_provider_type(object container, object provider): * if not isinstance(provider, container.provider_type): # <<<<<<<<<<<<<< @@ -18866,7 +18847,7 @@ static PyObject *__pyx_f_19dependency_injector_10containers__check_provider_type */ } - /* "dependency_injector/containers.pyx":792 + /* "dependency_injector/containers.pyx":787 * * * cpdef object _check_provider_type(object container, object provider): # <<<<<<<<<<<<<< @@ -18927,11 +18908,11 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_11_check_provider_t case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_provider)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, 1); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, 1); __PYX_ERR(0, 787, __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, 792, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_provider_type") < 0)) __PYX_ERR(0, 787, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -18944,7 +18925,7 @@ static PyObject *__pyx_pw_19dependency_injector_10containers_11_check_provider_t } 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, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_check_provider_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 787, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dependency_injector.containers._check_provider_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18966,7 +18947,7 @@ static PyObject *__pyx_pf_19dependency_injector_10containers_10_check_provider_t int __pyx_clineno = 0; __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, 792, __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, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19377,7 +19358,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___separa * plain_kwargs[key] = value * continue */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_n_s__27, __pyx_v_key, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 359, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_n_s__21, __pyx_v_key, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 359, __pyx_L1_error) __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { @@ -19427,7 +19408,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___separa __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_s__27) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s__27); + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_s__21) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s__21); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -23929,7 +23910,7 @@ static PyObject *__Pyx_CFunc_void____object____object____object____object___to_p * """wrap(future_result, args, future_args_kwargs, future) -> 'void'""" * f(future_result, args, future_args_kwargs, future) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_64__Pyx_CFunc_void____object____object____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_void____object____ob, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_64__Pyx_CFunc_void____object____object____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_void____object____ob, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_wrap = __pyx_t_1; __pyx_t_1 = 0; @@ -24117,7 +24098,7 @@ static PyObject *__Pyx_CFunc_void____object____object___to_py(void (*__pyx_v_f)( * """wrap(future_result, future) -> 'void'""" * f(future_result, future) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_44__Pyx_CFunc_void____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_void____object____ob_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_44__Pyx_CFunc_void____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_void____object____ob_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_wrap = __pyx_t_1; __pyx_t_1 = 0; @@ -24316,7 +24297,7 @@ static PyObject *__Pyx_CFunc_void____object____object____object___to_py(void (*_ * """wrap(future_result, call, future) -> 'void'""" * f(future_result, call, future) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_54__Pyx_CFunc_void____object____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_void____object____ob_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_54__Pyx_CFunc_void____object____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_void____object____ob_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_wrap = __pyx_t_1; __pyx_t_1 = 0; @@ -24509,7 +24490,7 @@ static PyObject *__Pyx_CFunc_object____object____object___to_py(PyObject *(*__py * """wrap(future_result, future)""" * return f(future_result, future) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_46__Pyx_CFunc_object____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____object, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_46__Pyx_CFunc_object____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____object, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_wrap = __pyx_t_1; __pyx_t_1 = 0; @@ -24677,9 +24658,8 @@ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_str static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources(PyObject *o) { struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v__any_initialized); - Py_CLEAR(p->__pyx_v__no_initialized_dependencies); - Py_CLEAR(p->__pyx_v__without_initialized_dependencies); + Py_CLEAR(p->__pyx_v__independent_resources); + Py_CLEAR(p->__pyx_v_resources); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources)))) { __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *)o); } else { @@ -24690,14 +24670,11 @@ static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_stru static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *)o; - if (p->__pyx_v__any_initialized) { - e = (*v)(p->__pyx_v__any_initialized, a); if (e) return e; + if (p->__pyx_v__independent_resources) { + e = (*v)(p->__pyx_v__independent_resources, a); if (e) return e; } - if (p->__pyx_v__no_initialized_dependencies) { - e = (*v)(p->__pyx_v__no_initialized_dependencies, a); if (e) return e; - } - if (p->__pyx_v__without_initialized_dependencies) { - e = (*v)(p->__pyx_v__without_initialized_dependencies, a); if (e) return e; + if (p->__pyx_v_resources) { + e = (*v)(p->__pyx_v_resources, a); if (e) return e; } return 0; } @@ -24705,14 +24682,11 @@ static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_stru static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources(PyObject *o) { PyObject* tmp; struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *)o; - tmp = ((PyObject*)p->__pyx_v__any_initialized); - p->__pyx_v__any_initialized = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v__independent_resources); + p->__pyx_v__independent_resources = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v__no_initialized_dependencies); - p->__pyx_v__no_initialized_dependencies = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v__without_initialized_dependencies); - p->__pyx_v__without_initialized_dependencies = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_resources); + p->__pyx_v_resources = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } @@ -24786,14 +24760,14 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st #endif }; -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized = 0; +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources = 0; -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized)); + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { @@ -24803,151 +24777,48 @@ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_str return o; } -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *)o; +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_resources); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *)o; - if (p->__pyx_v_resources) { - e = (*v)(p->__pyx_v_resources, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized *)o; - tmp = ((PyObject*)p->__pyx_v_resources); - p->__pyx_v_resources = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized = { - PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_2__any_initialized", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized, /*tp_traverse*/ - __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 - 0, /*tp_print*/ - #endif -}; - -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3_genexpr = 0; - -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_3_genexpr[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_3_genexpr(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_other_resource); Py_CLEAR(p->__pyx_v_resource); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_3_genexpr[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *)o); + Py_CLEAR(p->__pyx_v_resources); + Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_t_3); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources *)o; + if (p->__pyx_v_other_resource) { + e = (*v)(p->__pyx_v_other_resource, a); if (e) return e; } if (p->__pyx_v_resource) { e = (*v)(p->__pyx_v_resource, a); if (e) return e; } + if (p->__pyx_v_resources) { + e = (*v)(p->__pyx_v_resources, a); if (e) return e; + } + 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; + } return 0; } -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources = { PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "dependency_injector.containers.__pyx_scope_struct_2__independent_resources", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -24974,7 +24845,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -24990,7 +24861,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25011,14 +24882,14 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st #endif }; -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode = 0; +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown = 0; -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode)); + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { @@ -25028,256 +24899,35 @@ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_str return o; } -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_resources); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *)o; - if (p->__pyx_v_resources) { - e = (*v)(p->__pyx_v_resources, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode *)o; - tmp = ((PyObject*)p->__pyx_v_resources); - p->__pyx_v_resources = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode = { - PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_4__any_in_async_mode", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode, /*tp_traverse*/ - __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 - 0, /*tp_print*/ - #endif -}; - -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_5_genexpr[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5_genexpr = 0; - -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_5_genexpr[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_5_genexpr(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_resource); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_5_genexpr[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_resource) { - e = (*v)(p->__pyx_v_resource, a); if (e) return e; - } - return 0; -} - -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_5_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_5_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5_genexpr, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 - 0, /*tp_print*/ - #endif -}; - -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown = 0; - -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *)o; +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_futures); + Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_resource); Py_CLEAR(p->__pyx_v_resources); Py_CLEAR(p->__pyx_v_resources_to_shutdown); Py_CLEAR(p->__pyx_v_result); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *)o); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown *)o; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_futures) { e = (*v)(p->__pyx_v_futures, a); if (e) return e; } + if (p->__pyx_v_genexpr) { + e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; + } if (p->__pyx_v_resource) { e = (*v)(p->__pyx_v_resource, a); if (e) return e; } @@ -25293,12 +24943,12 @@ static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_stru return 0; } -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown = { +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown = { PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_6__async_ordered_shutdown", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown), /*tp_basicsize*/ + "dependency_injector.containers.__pyx_scope_struct_3__async_ordered_shutdown", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown, /*tp_dealloc*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -25325,7 +24975,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown, /*tp_traverse*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -25341,7 +24991,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown, /*tp_new*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25362,14 +25012,14 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st #endif }; -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_7_traverse[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_traverse = 0; +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_4_genexpr[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4_genexpr = 0; -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_traverse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_traverse > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_7_traverse[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_traverse]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse)); + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_4_genexpr[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { @@ -25379,21 +25029,473 @@ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_str return o; } -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_7_traverse(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *)o; +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_4_genexpr(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_cls); - Py_CLEAR(p->__pyx_v_types); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_traverse < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_7_traverse[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_traverse++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *)o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_resource); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_4_genexpr[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_7_traverse(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse *)o; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_resource) { + e = (*v)(p->__pyx_v_resource, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "dependency_injector.containers.__pyx_scope_struct_4_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_4_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown = 0; + +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_resources); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_resources) { + e = (*v)(p->__pyx_v_resources, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_resources); + p->__pyx_v_resources = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown = { + PyVarObject_HEAD_INIT(0, 0) + "dependency_injector.containers.__pyx_scope_struct_5__sync_ordered_shutdown", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown, /*tp_traverse*/ + __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_6_genexpr[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6_genexpr = 0; + +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_6_genexpr[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_6_genexpr(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_resource); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_6_genexpr[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_resource) { + e = (*v)(p->__pyx_v_resource, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "dependency_injector.containers.__pyx_scope_struct_6_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_6_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_7_genexpr[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_genexpr = 0; + +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_7_genexpr[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_7_genexpr(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_resource); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_7_genexpr[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_resource) { + e = (*v)(p->__pyx_v_resource, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "dependency_injector.containers.__pyx_scope_struct_7_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_8_traverse[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_traverse = 0; + +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_traverse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_traverse > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_8_traverse[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_traverse]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_8_traverse(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_cls); + Py_CLEAR(p->__pyx_v_types); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_traverse < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_8_traverse[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_traverse++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_8_traverse(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse *)o; if (p->__pyx_v_cls) { e = (*v)(p->__pyx_v_cls, a); if (e) return e; } @@ -25403,12 +25505,12 @@ static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_stru return 0; } -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse = { +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse = { PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_7_traverse", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_7_traverse), /*tp_basicsize*/ + "dependency_injector.containers.__pyx_scope_struct_8_traverse", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_traverse), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_7_traverse, /*tp_dealloc*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_8_traverse, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -25435,7 +25537,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_7_traverse, /*tp_traverse*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_8_traverse, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -25451,7 +25553,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_7_traverse, /*tp_new*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_traverse, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25472,14 +25574,14 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st #endif }; -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_8_override[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_override = 0; +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_9_override[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_override = 0; -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_override(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_override(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_override > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_8_override[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_override]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override)); + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_override > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_9_override[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_override]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { @@ -25489,41 +25591,41 @@ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_str return o; } -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_8_override(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *)o; +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_9_override(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_container); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_override < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_8_override[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_8_override++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *)o); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_override < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_9_override[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_override++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_8_override(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_9_override(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *)o; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *)o; if (p->__pyx_v_container) { e = (*v)(p->__pyx_v_container, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_8_override(PyObject *o) { +static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_9_override(PyObject *o) { PyObject* tmp; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override *)o; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override *)o; tmp = ((PyObject*)p->__pyx_v_container); p->__pyx_v_container = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override = { +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override = { PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_8_override", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_8_override), /*tp_basicsize*/ + "dependency_injector.containers.__pyx_scope_struct_9_override", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_override), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_8_override, /*tp_dealloc*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_9_override, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -25550,8 +25652,8 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_8_override, /*tp_traverse*/ - __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_8_override, /*tp_clear*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_9_override, /*tp_traverse*/ + __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_9_override, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -25566,7 +25668,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_8_override, /*tp_new*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_override, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25587,14 +25689,14 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st #endif }; -static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_9_copy[8]; -static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_copy = 0; +static struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_10_copy[8]; +static int __pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_10_copy = 0; -static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_copy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_10_copy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_copy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy)))) { - o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_9_copy[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_copy]; - memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy)); + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_10_copy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy)))) { + o = (PyObject*)__pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_10_copy[--__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_10_copy]; + memset(o, 0, sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { @@ -25604,21 +25706,21 @@ static PyObject *__pyx_tp_new_19dependency_injector_10containers___pyx_scope_str return o; } -static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_9_copy(PyObject *o) { - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *)o; +static void __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_10_copy(PyObject *o) { + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v__get_providers_memo); Py_CLEAR(p->__pyx_v_container); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_copy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy)))) { - __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_9_copy[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_9_copy++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *)o); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_10_copy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy)))) { + __pyx_freelist_19dependency_injector_10containers___pyx_scope_struct_10_copy[__pyx_freecount_19dependency_injector_10containers___pyx_scope_struct_10_copy++] = ((struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_9_copy(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_10_copy(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *)o; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *)o; if (p->__pyx_v__get_providers_memo) { e = (*v)(p->__pyx_v__get_providers_memo, a); if (e) return e; } @@ -25628,9 +25730,9 @@ static int __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_stru return 0; } -static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_9_copy(PyObject *o) { +static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_10_copy(PyObject *o) { PyObject* tmp; - struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy *)o; + struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *p = (struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy *)o; tmp = ((PyObject*)p->__pyx_v__get_providers_memo); p->__pyx_v__get_providers_memo = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -25640,12 +25742,12 @@ static int __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_ return 0; } -static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy = { +static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy = { PyVarObject_HEAD_INIT(0, 0) - "dependency_injector.containers.__pyx_scope_struct_9_copy", /*tp_name*/ - sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_9_copy), /*tp_basicsize*/ + "dependency_injector.containers.__pyx_scope_struct_10_copy", /*tp_name*/ + sizeof(struct __pyx_obj_19dependency_injector_10containers___pyx_scope_struct_10_copy), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_9_copy, /*tp_dealloc*/ + __pyx_tp_dealloc_19dependency_injector_10containers___pyx_scope_struct_10_copy, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -25672,8 +25774,8 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_9_copy, /*tp_traverse*/ - __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_9_copy, /*tp_clear*/ + __pyx_tp_traverse_19dependency_injector_10containers___pyx_scope_struct_10_copy, /*tp_traverse*/ + __pyx_tp_clear_19dependency_injector_10containers___pyx_scope_struct_10_copy, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -25688,7 +25790,7 @@ static PyTypeObject __pyx_type_19dependency_injector_10containers___pyx_scope_st 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_9_copy, /*tp_new*/ + __pyx_tp_new_19dependency_injector_10containers___pyx_scope_struct_10_copy, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -26189,8 +26291,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DynamicContainer_shutdown_resour_5, __pyx_k_DynamicContainer_shutdown_resour_5, sizeof(__pyx_k_DynamicContainer_shutdown_resour_5), 0, 0, 1, 1}, {&__pyx_n_s_DynamicContainer_shutdown_resour_6, __pyx_k_DynamicContainer_shutdown_resour_6, sizeof(__pyx_k_DynamicContainer_shutdown_resour_6), 0, 0, 1, 1}, {&__pyx_n_s_DynamicContainer_shutdown_resour_7, __pyx_k_DynamicContainer_shutdown_resour_7, sizeof(__pyx_k_DynamicContainer_shutdown_resour_7), 0, 0, 1, 1}, - {&__pyx_n_s_DynamicContainer_shutdown_resour_8, __pyx_k_DynamicContainer_shutdown_resour_8, sizeof(__pyx_k_DynamicContainer_shutdown_resour_8), 0, 0, 1, 1}, - {&__pyx_n_s_DynamicContainer_shutdown_resour_9, __pyx_k_DynamicContainer_shutdown_resour_9, sizeof(__pyx_k_DynamicContainer_shutdown_resour_9), 0, 0, 1, 1}, {&__pyx_n_s_DynamicContainer_traverse, __pyx_k_DynamicContainer_traverse, sizeof(__pyx_k_DynamicContainer_traverse), 0, 0, 1, 1}, {&__pyx_n_s_DynamicContainer_unwire, __pyx_k_DynamicContainer_unwire, sizeof(__pyx_k_DynamicContainer_unwire), 0, 0, 1, 1}, {&__pyx_n_s_DynamicContainer_wire, __pyx_k_DynamicContainer_wire, sizeof(__pyx_k_DynamicContainer_wire), 0, 0, 1, 1}, @@ -26217,17 +26317,15 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Unable_to_load_yaml_schema_PyYAM, __pyx_k_Unable_to_load_yaml_schema_PyYAM, sizeof(__pyx_k_Unable_to_load_yaml_schema_PyYAM), 0, 0, 1, 0}, {&__pyx_kp_s_Unable_to_resolve_resources_shut, __pyx_k_Unable_to_resolve_resources_shut, sizeof(__pyx_k_Unable_to_resolve_resources_shut), 0, 0, 1, 0}, {&__pyx_kp_s_Wiring_requires_Python_3_6_or_ab, __pyx_k_Wiring_requires_Python_3_6_or_ab, sizeof(__pyx_k_Wiring_requires_Python_3_6_or_ab), 0, 0, 1, 0}, - {&__pyx_n_s__124, __pyx_k__124, sizeof(__pyx_k__124), 0, 0, 1, 1}, - {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, - {&__pyx_kp_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 0}, - {&__pyx_n_s__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 1, 1}, - {&__pyx_n_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 1}, + {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, + {&__pyx_n_s__118, __pyx_k__118, sizeof(__pyx_k__118), 0, 0, 1, 1}, + {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 0}, + {&__pyx_n_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 1}, + {&__pyx_n_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 1}, {&__pyx_n_s_add_done_callback, __pyx_k_add_done_callback, sizeof(__pyx_k_add_done_callback), 0, 0, 1, 1}, {&__pyx_n_s_add_metaclass, __pyx_k_add_metaclass, sizeof(__pyx_k_add_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_all_providers, __pyx_k_all_providers, sizeof(__pyx_k_all_providers), 0, 0, 1, 1}, {&__pyx_n_s_alt_names, __pyx_k_alt_names, sizeof(__pyx_k_alt_names), 0, 0, 1, 1}, - {&__pyx_n_s_any_in_async_mode, __pyx_k_any_in_async_mode, sizeof(__pyx_k_any_in_async_mode), 0, 0, 1, 1}, - {&__pyx_n_s_any_initialized, __pyx_k_any_initialized, sizeof(__pyx_k_any_initialized), 0, 0, 1, 1}, {&__pyx_n_s_apply_container_providers_overri, __pyx_k_apply_container_providers_overri, sizeof(__pyx_k_apply_container_providers_overri), 0, 0, 1, 1}, {&__pyx_n_s_apply_overridings, __pyx_k_apply_overridings, sizeof(__pyx_k_apply_overridings), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -26280,7 +26378,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_fetch_self, __pyx_k_fetch_self, sizeof(__pyx_k_fetch_self), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, - {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_from_json_schema, __pyx_k_from_json_schema, sizeof(__pyx_k_from_json_schema), 0, 0, 1, 1}, {&__pyx_n_s_from_providers, __pyx_k_from_providers, sizeof(__pyx_k_from_providers), 0, 0, 1, 1}, @@ -26298,6 +26395,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_has_undefined_dependencies, __pyx_k_has_undefined_dependencies, sizeof(__pyx_k_has_undefined_dependencies), 0, 1, 0, 0}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_independent_resources, __pyx_k_independent_resources, sizeof(__pyx_k_independent_resources), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_inherited_providers, __pyx_k_inherited_providers, sizeof(__pyx_k_inherited_providers), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, @@ -26327,9 +26425,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, - {&__pyx_n_s_no_initialized_dependencies, __pyx_k_no_initialized_dependencies, sizeof(__pyx_k_no_initialized_dependencies), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_other_resource, __pyx_k_other_resource, sizeof(__pyx_k_other_resource), 0, 0, 1, 1}, {&__pyx_n_s_overridden, __pyx_k_overridden, sizeof(__pyx_k_overridden), 0, 0, 1, 1}, {&__pyx_n_s_override, __pyx_k_override, sizeof(__pyx_k_override), 0, 0, 1, 1}, {&__pyx_n_s_override_locals__decorator, __pyx_k_override_locals__decorator, sizeof(__pyx_k_override_locals__decorator), 0, 0, 1, 1}, @@ -26402,7 +26500,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_wired_to_modules, __pyx_k_wired_to_modules, sizeof(__pyx_k_wired_to_modules), 0, 0, 1, 1}, {&__pyx_n_s_wired_to_packages, __pyx_k_wired_to_packages, sizeof(__pyx_k_wired_to_packages), 0, 0, 1, 1}, {&__pyx_n_s_wiring, __pyx_k_wiring, sizeof(__pyx_k_wiring), 0, 0, 1, 1}, - {&__pyx_n_s_without_initialized_dependencie, __pyx_k_without_initialized_dependencie, sizeof(__pyx_k_without_initialized_dependencie), 0, 0, 1, 1}, {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1}, {&__pyx_n_s_yaml, __pyx_k_yaml, sizeof(__pyx_k_yaml), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, @@ -26412,15 +26509,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 8, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 147, __pyx_L1_error) - __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 545, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 80, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_builtin_filter = __Pyx_GetBuiltinName(__pyx_n_s_filter); if (!__pyx_builtin_filter) __PYX_ERR(0, 300, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 312, __pyx_L1_error) - __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 391, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 755, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 388, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(1, 477, __pyx_L1_error) return 0; @@ -26454,135 +26550,99 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice__3); __Pyx_GIVEREF(__pyx_slice__3); - /* "dependency_injector/containers.pyx":312 - * resources_to_shutdown = _without_initialized_dependencies(resources) + /* "dependency_injector/containers.pyx":307 + * resources_to_shutdown = list(_independent_resources(resources)) * if not resources_to_shutdown: * raise RuntimeError('Unable to resolve resources shutdown order') # <<<<<<<<<<<<<< * futures = [] * for resource in resources_to_shutdown: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_resolve_resources_shut); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_resolve_resources_shut); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "dependency_injector/containers.pyx":293 * def shutdown_resources(self): * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): # <<<<<<<<<<<<<< - * for related in resource.related: - * if isinstance(related, providers.Resource) and related.initialized: + * def _independent_resources(resources): # <<<<<<<<<<<<<< + * for resource in resources: + * for other_resource in resources: */ - __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_resource, __pyx_n_s_related); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_resources, __pyx_n_s_resource, __pyx_n_s_other_resource); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_no_initialized_dependencies, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_independent_resources, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 293, __pyx_L1_error) - /* "dependency_injector/containers.pyx":299 - * return True - * - * def _without_initialized_dependencies(resources): # <<<<<<<<<<<<<< - * return list(filter(_no_initialized_dependencies, resources)) - * - */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_resources); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_without_initialized_dependencie, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 299, __pyx_L1_error) - - /* "dependency_injector/containers.pyx":302 - * return list(filter(_no_initialized_dependencies, resources)) - * - * def _any_initialized(resources): # <<<<<<<<<<<<<< - * return any(resource.initialized for resource in resources) - * - */ - __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_resources, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_any_initialized, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 302, __pyx_L1_error) - - /* "dependency_injector/containers.pyx":305 - * return any(resource.initialized for resource in resources) - * - * def _any_in_async_mode(resources): # <<<<<<<<<<<<<< - * return any(resource.is_async_mode_enabled() for resource in resources) - * - */ - __pyx_tuple__11 = PyTuple_Pack(3, __pyx_n_s_resources, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_any_in_async_mode, 305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 305, __pyx_L1_error) - - /* "dependency_injector/containers.pyx":308 - * return any(resource.is_async_mode_enabled() for resource in resources) + /* "dependency_injector/containers.pyx":303 + * yield resource * * async def _async_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ - __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_resources, __pyx_n_s_resources_to_shutdown, __pyx_n_s_futures, __pyx_n_s_resource, __pyx_n_s_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_async_ordered_shutdown, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_resources, __pyx_n_s_resources_to_shutdown, __pyx_n_s_futures, __pyx_n_s_resource, __pyx_n_s_result, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_async_ordered_shutdown, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 303, __pyx_L1_error) - /* "dependency_injector/containers.pyx":320 + /* "dependency_injector/containers.pyx":315 * await asyncio.gather(*futures) * * def _sync_ordered_shutdown(resources): # <<<<<<<<<<<<<< - * while _any_initialized(resources): - * resources_to_shutdown = _without_initialized_dependencies(resources) + * while any(resource.initialized for resource in resources): + * resources_to_shutdown = list(_independent_resources(resources)) */ - __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_resources, __pyx_n_s_resources_to_shutdown, __pyx_n_s_resource); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_sync_ordered_shutdown, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_resources, __pyx_n_s_resources_to_shutdown, __pyx_n_s_resource, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_sync_ordered_shutdown, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 315, __pyx_L1_error) - /* "dependency_injector/containers.pyx":391 + /* "dependency_injector/containers.pyx":386 * loader = yaml.SafeLoader * * with open(filepath) as file: # <<<<<<<<<<<<<< * schema = yaml.load(file, loader) * */ - __pyx_tuple__19 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__13 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); - /* "dependency_injector/containers.pyx":734 + /* "dependency_injector/containers.pyx":729 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _decorator(object overriding_container): # <<<<<<<<<<<<<< * """Overriding decorator.""" * container.override(overriding_container) */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_overriding_container); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_decorator, 734, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_overriding_container); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_decorator, 729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 729, __pyx_L1_error) - /* "dependency_injector/containers.pyx":754 + /* "dependency_injector/containers.pyx":749 * :rtype: callable(:py:class:`DeclarativeContainer`) * """ * def _get_providers_memo(from_providers, source_providers): # <<<<<<<<<<<<<< * memo = dict() * */ - __pyx_tuple__23 = PyTuple_Pack(7, __pyx_n_s_from_providers, __pyx_n_s_source_providers, __pyx_n_s_memo, __pyx_n_s_name, __pyx_n_s_provider, __pyx_n_s_source_provider, __pyx_n_s_sub_memo); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_get_providers_memo, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_from_providers, __pyx_n_s_source_providers, __pyx_n_s_memo, __pyx_n_s_name, __pyx_n_s_provider, __pyx_n_s_source_provider, __pyx_n_s_sub_memo); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_get_providers_memo, 749, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 749, __pyx_L1_error) - /* "dependency_injector/containers.pyx":770 + /* "dependency_injector/containers.pyx":765 * return memo * * def _decorator(copied_container): # <<<<<<<<<<<<<< * memo = _get_providers_memo(copied_container.cls_providers, container.providers) * */ - __pyx_tuple__25 = PyTuple_Pack(5, __pyx_n_s_copied_container, __pyx_n_s_memo, __pyx_n_s_providers_copy, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_decorator, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_s_copied_container, __pyx_n_s_memo, __pyx_n_s_providers_copy, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_decorator, 765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 765, __pyx_L1_error) /* "cfunc.to_py":65 * @cname("__Pyx_CFunc_void____object____object____object____object___to_py") @@ -26591,22 +26651,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """wrap(future_result, args, future_args_kwargs, future) -> 'void'""" * f(future_result, args, future_args_kwargs, future) */ - __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_future_result, __pyx_n_s_args, __pyx_n_s_future_args_kwargs, __pyx_n_s_future); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_future_result, __pyx_n_s_args, __pyx_n_s_future_args_kwargs, __pyx_n_s_future); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_future_result, __pyx_n_s_future); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_future_result, __pyx_n_s_call, __pyx_n_s_future); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_future_result, __pyx_n_s_future); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(2, 65, __pyx_L1_error) - __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_future_result, __pyx_n_s_future); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(2, 65, __pyx_L1_error) - __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_future_result, __pyx_n_s_call, __pyx_n_s_future); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(2, 65, __pyx_L1_error) - __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_future_result, __pyx_n_s_future); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(2, 65, __pyx_L1_error) + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(2, 65, __pyx_L1_error) /* "dependency_injector/containers.pyx":22 * @@ -26615,12 +26675,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * from .wiring import wire, unwire * else: */ - __pyx_slice__37 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__37); - __Pyx_GIVEREF(__pyx_slice__37); - __pyx_tuple__38 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_6); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_slice__31 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); + __pyx_tuple__32 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_6); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "dependency_injector/containers.pyx":25 * from .wiring import wire, unwire @@ -26629,10 +26689,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * raise NotImplementedError('Wiring requires Python 3.6 or above') * */ - __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_wire, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_wire, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 25, __pyx_L1_error) /* "dependency_injector/containers.pyx":28 * raise NotImplementedError('Wiring requires Python 3.6 or above') @@ -26641,10 +26701,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * raise NotImplementedError('Wiring requires Python 3.6 or above') * */ - __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_unwire, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_unwire, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 28, __pyx_L1_error) /* "dependency_injector/containers.pyx":32 * @@ -26653,9 +26713,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Abstract container.""" * */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "dependency_injector/containers.pyx":67 * __IS_CONTAINER__ = True @@ -26664,10 +26724,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Initializer. * */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_init, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_init, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 67, __pyx_L1_error) /* "dependency_injector/containers.pyx":82 * super(DynamicContainer, self).__init__() @@ -26676,10 +26736,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Create and return full copy of container.""" * copied = memo.get(id(self)) */ - __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_memo, __pyx_n_s_copied, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_deepcopy_2, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_memo, __pyx_n_s_copied, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_deepcopy_2, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 82, __pyx_L1_error) /* "dependency_injector/containers.pyx":106 * return copied @@ -26688,10 +26748,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Set instance attribute. * */ - __pyx_tuple__48 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_setattr, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_setattr, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 106, __pyx_L1_error) /* "dependency_injector/containers.pyx":132 * super(DynamicContainer, self).__setattr__(name, value) @@ -26700,10 +26760,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Delete instance attribute. * */ - __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_name); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_delattr, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_name); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_delattr, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 132, __pyx_L1_error) /* "dependency_injector/containers.pyx":148 * @@ -26712,10 +26772,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Return dependency providers dictionary. * */ - __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_dependencies, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_dependencies, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 148, __pyx_L1_error) /* "dependency_injector/containers.pyx":163 * } @@ -26724,13 +26784,13 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Return providers traversal generator.""" * yield from providers.traverse(*self.providers.values(), types=types) */ - __pyx_tuple__54 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_types); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_traverse, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 163, __pyx_L1_error) - __pyx_tuple__55 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_types); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_traverse, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_tuple__49 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "dependency_injector/containers.pyx":167 * yield from providers.traverse(*self.providers.values(), types=types) @@ -26739,10 +26799,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Set container providers. * */ - __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_providers, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_set_providers, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_providers, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_set_providers, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 167, __pyx_L1_error) /* "dependency_injector/containers.pyx":179 * setattr(self, name, provider) @@ -26751,10 +26811,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Set container provider. * */ - __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_set_provider, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_set_provider, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 179, __pyx_L1_error) /* "dependency_injector/containers.pyx":192 * setattr(self, name, provider) @@ -26763,10 +26823,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Override current container by overriding container. * */ - __pyx_tuple__60 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_overriding, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_overriding, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 192, __pyx_L1_error) /* "dependency_injector/containers.pyx":215 * pass @@ -26775,10 +26835,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Override container providers. * */ - __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_overriding_providers, __pyx_n_s_name, __pyx_n_s_overriding_provider, __pyx_n_s_container_provider); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override_providers, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_overriding_providers, __pyx_n_s_name, __pyx_n_s_overriding_provider, __pyx_n_s_container_provider); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override_providers, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 215, __pyx_L1_error) /* "dependency_injector/containers.pyx":228 * container_provider.override(overriding_provider) @@ -26787,10 +26847,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Reset last overriding provider for each container providers. * */ - __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_last_overriding, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_last_overriding, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 228, __pyx_L1_error) /* "dependency_injector/containers.pyx":241 * provider.reset_last_overriding() @@ -26799,10 +26859,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Reset all overridings for each container providers. * */ - __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_override, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_override, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 241, __pyx_L1_error) /* "dependency_injector/containers.pyx":251 * provider.reset_override() @@ -26811,13 +26871,13 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Wire container providers with provided packages and modules. * */ - __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_modules, __pyx_n_s_packages); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_wire, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_tuple__70 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_modules, __pyx_n_s_packages); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_wire, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); /* "dependency_injector/containers.pyx":268 * self.wired_to_packages.extend(packages) @@ -26826,10 +26886,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Unwire container providers from previously wired packages and modules.""" * unwire( */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_unwire, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_unwire, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 268, __pyx_L1_error) /* "dependency_injector/containers.pyx":278 * self.wired_to_packages.clear() @@ -26838,340 +26898,340 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """Initialize all container resources.""" * futures = [] */ - __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_futures, __pyx_n_s_provider, __pyx_n_s_resource); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); - __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_init_resources, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_tuple__67 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_futures, __pyx_n_s_provider, __pyx_n_s_resource); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_init_resources, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 278, __pyx_L1_error) /* "dependency_injector/containers.pyx":291 * return asyncio.gather(*futures) * * def shutdown_resources(self): # <<<<<<<<<<<<<< * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): + * def _independent_resources(resources): */ - __pyx_tuple__75 = PyTuple_Pack(14, __pyx_n_s_self_2, __pyx_n_s_no_initialized_dependencies, __pyx_n_s_no_initialized_dependencies, __pyx_n_s_without_initialized_dependencie, __pyx_n_s_without_initialized_dependencie, __pyx_n_s_any_initialized, __pyx_n_s_any_initialized, __pyx_n_s_any_in_async_mode, __pyx_n_s_any_in_async_mode, __pyx_n_s_async_ordered_shutdown, __pyx_n_s_async_ordered_shutdown, __pyx_n_s_sync_ordered_shutdown, __pyx_n_s_sync_ordered_shutdown, __pyx_n_s_resources); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__75); - __Pyx_GIVEREF(__pyx_tuple__75); - __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_shutdown_resources, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_tuple__69 = PyTuple_Pack(10, __pyx_n_s_self_2, __pyx_n_s_independent_resources, __pyx_n_s_independent_resources, __pyx_n_s_async_ordered_shutdown, __pyx_n_s_async_ordered_shutdown, __pyx_n_s_sync_ordered_shutdown, __pyx_n_s_sync_ordered_shutdown, __pyx_n_s_resources, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_shutdown_resources, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 291, __pyx_L1_error) - /* "dependency_injector/containers.pyx":334 + /* "dependency_injector/containers.pyx":329 * return _sync_ordered_shutdown(resources) * * def apply_container_providers_overridings(self): # <<<<<<<<<<<<<< * """Apply container providers' overridings.""" * for provider in self.traverse(types=[providers.Container]): */ - __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); - __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_apply_container_providers_overri, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_apply_container_providers_overri, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 329, __pyx_L1_error) - /* "dependency_injector/containers.pyx":339 + /* "dependency_injector/containers.pyx":334 * provider.apply_overridings() * * def reset_singletons(self): # <<<<<<<<<<<<<< * """Reset container singletons.""" * for provider in self.traverse(types=[providers.BaseSingleton]): */ - __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_singletons, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_singletons, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 334, __pyx_L1_error) - /* "dependency_injector/containers.pyx":345 + /* "dependency_injector/containers.pyx":340 * return SingletonResetContext(self) * * def check_dependencies(self): # <<<<<<<<<<<<<< * """Check if container dependencies are defined. * */ - __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_undefined, __pyx_n_s_container_name, __pyx_n_s_undefined_names, __pyx_n_s_dependency); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); - __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_check_dependencies, 345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_undefined, __pyx_n_s_container_name, __pyx_n_s_undefined_names, __pyx_n_s_dependency); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_check_dependencies, 340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 340, __pyx_L1_error) - /* "dependency_injector/containers.pyx":369 + /* "dependency_injector/containers.pyx":364 * ) * * def from_schema(self, schema): # <<<<<<<<<<<<<< * """Build container providers from schema.""" * from .schema import build_schema */ - __pyx_tuple__83 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_schema, __pyx_n_s_build_schema, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); - __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_from_schema, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_tuple__77 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_schema, __pyx_n_s_build_schema, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_from_schema, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 364, __pyx_L1_error) - /* "dependency_injector/containers.pyx":375 + /* "dependency_injector/containers.pyx":370 * self.set_provider(name, provider) * * def from_yaml_schema(self, filepath, loader=None): # <<<<<<<<<<<<<< * """Build container providers from YAML schema. * */ - __pyx_tuple__85 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_filepath, __pyx_n_s_loader, __pyx_n_s_file, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); - __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_from_yaml_schema, 375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 375, __pyx_L1_error) - __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_tuple__79 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_filepath, __pyx_n_s_loader, __pyx_n_s_file, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_from_yaml_schema, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_tuple__81 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); - /* "dependency_injector/containers.pyx":396 + /* "dependency_injector/containers.pyx":391 * self.from_schema(schema) * * def from_json_schema(self, filepath): # <<<<<<<<<<<<<< * """Build container providers from JSON schema.""" * with open(filepath) as file: */ - __pyx_tuple__88 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_filepath, __pyx_n_s_file, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); - __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_from_json_schema, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_tuple__82 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_filepath, __pyx_n_s_file, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_from_json_schema, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 391, __pyx_L1_error) - /* "dependency_injector/containers.pyx":402 + /* "dependency_injector/containers.pyx":397 * self.from_schema(schema) * * def resolve_provider_name(self, provider): # <<<<<<<<<<<<<< * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): */ - __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_provider, __pyx_n_s_provider_name, __pyx_n_s_container_provider); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); - __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_resolve_provider_name, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_provider, __pyx_n_s_provider_name, __pyx_n_s_container_provider); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_resolve_provider_name, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 397, __pyx_L1_error) - /* "dependency_injector/containers.pyx":411 + /* "dependency_injector/containers.pyx":406 * * @property * def parent_name(self): # <<<<<<<<<<<<<< * """Return parent name.""" * if self.parent: */ - __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); - __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_parent_name, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_parent_name, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 406, __pyx_L1_error) - /* "dependency_injector/containers.pyx":421 + /* "dependency_injector/containers.pyx":416 * return None * * def assign_parent(self, parent): # <<<<<<<<<<<<<< * """Assign parent.""" * self.parent = parent */ - __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__94); - __Pyx_GIVEREF(__pyx_tuple__94); - __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_assign_parent, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_assign_parent, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 416, __pyx_L1_error) - /* "dependency_injector/containers.pyx":429 + /* "dependency_injector/containers.pyx":424 * """Declarative inversion of control container meta class.""" * * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" * self = mcs.__fetch_self(attributes) */ - __pyx_tuple__96 = PyTuple_Pack(18, __pyx_n_s_mcs, __pyx_n_s_class_name, __pyx_n_s_bases, __pyx_n_s_attributes, __pyx_n_s_self_2, __pyx_n_s_containers, __pyx_n_s_cls_providers, __pyx_n_s_inherited_providers, __pyx_n_s_all_providers, __pyx_n_s_cls, __pyx_n_s_provider, __pyx_n_s_name, __pyx_n_s_container, __pyx_n_s_name, __pyx_n_s_provider, __pyx_n_s_base, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_new, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_tuple__90 = PyTuple_Pack(18, __pyx_n_s_mcs, __pyx_n_s_class_name, __pyx_n_s_bases, __pyx_n_s_attributes, __pyx_n_s_self_2, __pyx_n_s_containers, __pyx_n_s_cls_providers, __pyx_n_s_inherited_providers, __pyx_n_s_all_providers, __pyx_n_s_cls, __pyx_n_s_provider, __pyx_n_s_name, __pyx_n_s_container, __pyx_n_s_name, __pyx_n_s_provider, __pyx_n_s_base, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_new, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 424, __pyx_L1_error) - /* "dependency_injector/containers.pyx":477 + /* "dependency_injector/containers.pyx":472 * return cls * * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< * """Set class attribute. * */ - __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_setattr, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_tuple__92 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_setattr, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 472, __pyx_L1_error) - /* "dependency_injector/containers.pyx":501 + /* "dependency_injector/containers.pyx":496 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * * def __delattr__(cls, str name): # <<<<<<<<<<<<<< * """Delete class attribute. * */ - __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_name); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_delattr, 501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_name); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_delattr, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 496, __pyx_L1_error) - /* "dependency_injector/containers.pyx":518 + /* "dependency_injector/containers.pyx":513 * * @property * def dependencies(cls): # <<<<<<<<<<<<<< * """Return dependency providers dictionary. * */ - __pyx_tuple__102 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 518, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_dependencies, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_tuple__96 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_dependencies, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 513, __pyx_L1_error) - /* "dependency_injector/containers.pyx":533 + /* "dependency_injector/containers.pyx":528 * } * * def traverse(cls, types=None): # <<<<<<<<<<<<<< * """Return providers traversal generator.""" * yield from providers.traverse(*cls.providers.values(), types=types) */ - __pyx_tuple__104 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_types); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_traverse, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 533, __pyx_L1_error) - __pyx_tuple__105 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__105); - __Pyx_GIVEREF(__pyx_tuple__105); + __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_types); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_traverse, 528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_tuple__99 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); - /* "dependency_injector/containers.pyx":537 + /* "dependency_injector/containers.pyx":532 * yield from providers.traverse(*cls.providers.values(), types=types) * * def resolve_provider_name(cls, provider): # <<<<<<<<<<<<<< * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): */ - __pyx_tuple__106 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_provider, __pyx_n_s_provider_name, __pyx_n_s_container_provider); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_resolve_provider_name, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_tuple__100 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_provider, __pyx_n_s_provider_name, __pyx_n_s_container_provider); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_resolve_provider_name, 532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 532, __pyx_L1_error) - /* "dependency_injector/containers.pyx":546 + /* "dependency_injector/containers.pyx":541 * * @property * def parent_name(cls): # <<<<<<<<<<<<<< * """Return parent name.""" * return cls.__name__ */ - __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_parent_name, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_tuple__102 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_parent_name, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 541, __pyx_L1_error) - /* "dependency_injector/containers.pyx":551 + /* "dependency_injector/containers.pyx":546 * * @staticmethod * def __fetch_self(attributes): # <<<<<<<<<<<<<< * self = None * alt_names = [] */ - __pyx_tuple__110 = PyTuple_Pack(5, __pyx_n_s_attributes, __pyx_n_s_self_2, __pyx_n_s_alt_names, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_fetch_self, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_attributes, __pyx_n_s_self_2, __pyx_n_s_alt_names, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_fetch_self, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 546, __pyx_L1_error) - /* "dependency_injector/containers.pyx":636 + /* "dependency_injector/containers.pyx":631 * """ * * def __new__(cls, **overriding_providers): # <<<<<<<<<<<<<< * """Constructor. * */ - __pyx_tuple__112 = PyTuple_Pack(7, __pyx_n_s_cls, __pyx_n_s_overriding_providers, __pyx_n_s_container, __pyx_n_s_copied_providers, __pyx_n_s_copied_self, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__112); - __Pyx_GIVEREF(__pyx_tuple__112); - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_new, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_tuple__106 = PyTuple_Pack(7, __pyx_n_s_cls, __pyx_n_s_overriding_providers, __pyx_n_s_container, __pyx_n_s_copied_providers, __pyx_n_s_copied_self, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_new, 631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 631, __pyx_L1_error) - /* "dependency_injector/containers.pyx":663 + /* "dependency_injector/containers.pyx":658 * * @classmethod * def override(cls, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ - __pyx_tuple__114 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_overriding, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_tuple__108 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_overriding, __pyx_n_s_name, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override, 658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 658, __pyx_L1_error) - /* "dependency_injector/containers.pyx":687 + /* "dependency_injector/containers.pyx":682 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< * """Reset last overriding provider for each container providers. * */ - __pyx_tuple__116 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__116); - __Pyx_GIVEREF(__pyx_tuple__116); - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_last_overriding, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_last_overriding, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 682, __pyx_L1_error) - /* "dependency_injector/containers.pyx":701 + /* "dependency_injector/containers.pyx":696 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< * """Reset all overridings for each container providers. * */ - __pyx_tuple__118 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_override, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_tuple__112 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_provider); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_reset_override, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 696, __pyx_L1_error) - /* "dependency_injector/containers.pyx":714 + /* "dependency_injector/containers.pyx":709 * class SingletonResetContext: * * def __init__(self, container): # <<<<<<<<<<<<<< * self._container = container * */ - __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_container); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_init, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_tuple__114 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_container); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_init, 709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 709, __pyx_L1_error) - /* "dependency_injector/containers.pyx":717 + /* "dependency_injector/containers.pyx":712 * self._container = container * * def __enter__(self): # <<<<<<<<<<<<<< * return self._container * */ - __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_enter, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_enter, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 712, __pyx_L1_error) - /* "dependency_injector/containers.pyx":720 + /* "dependency_injector/containers.pyx":715 * return self._container * * def __exit__(self, *_): # <<<<<<<<<<<<<< * self._container.reset_singletons() * */ - __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s__124); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__125); - __Pyx_GIVEREF(__pyx_tuple__125); - __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_exit, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_tuple__119 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s__118); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_exit, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 715, __pyx_L1_error) - /* "dependency_injector/containers.pyx":724 + /* "dependency_injector/containers.pyx":719 * * * def override(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` overriding decorator. * */ - __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_container, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__127); - __Pyx_GIVEREF(__pyx_tuple__127); - __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_tuple__121 = PyTuple_Pack(3, __pyx_n_s_container, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_override, 719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 719, __pyx_L1_error) - /* "dependency_injector/containers.pyx":741 + /* "dependency_injector/containers.pyx":736 * * * def copy(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` copying decorator. * */ - __pyx_tuple__129 = PyTuple_Pack(5, __pyx_n_s_container, __pyx_n_s_get_providers_memo, __pyx_n_s_get_providers_memo, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__129); - __Pyx_GIVEREF(__pyx_tuple__129); - __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_copy, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_tuple__123 = PyTuple_Pack(5, __pyx_n_s_container, __pyx_n_s_get_providers_memo, __pyx_n_s_get_providers_memo, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_containe, __pyx_n_s_copy, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -27255,70 +27315,78 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_1_shutdown_resources; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources) < 0) __PYX_ERR(0, 293, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__any_initialized; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_2__independent_resources; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown) < 0) __PYX_ERR(0, 303, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3_genexpr; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode) < 0) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_3__async_ordered_shutdown; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 304, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4__any_in_async_mode; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_4_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_4_genexpr; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown) < 0) __PYX_ERR(0, 315, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_5_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_5_genexpr; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown) < 0) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_5__sync_ordered_shutdown; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 316, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_6__async_ordered_shutdown; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse) < 0) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_6_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_6_genexpr; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 324, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_7_traverse = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_traverse; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_7_genexpr = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_7_genexpr; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse) < 0) __PYX_ERR(0, 528, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_8_override = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_override; - if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy) < 0) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_8_traverse = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_8_traverse; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override) < 0) __PYX_ERR(0, 719, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy.tp_print = 0; + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override.tp_print = 0; #endif - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy.tp_getattro == PyObject_GenericGetAttr)) { - __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } - __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_9_copy = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_copy; + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_9_override = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_9_override; + if (PyType_Ready(&__pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy) < 0) __PYX_ERR(0, 736, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy.tp_dictoffset && __pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_19dependency_injector_10containers___pyx_scope_struct_10_copy = &__pyx_type_19dependency_injector_10containers___pyx_scope_struct_10_copy; if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_void____object____object____object____object___to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_scope_struct____Pyx_CFunc_void____object____object____object____object___to_py.tp_print = 0; @@ -28000,7 +28068,7 @@ if (!__Pyx_RefNanny) { __Pyx_INCREF(__pyx_n_s_errors); __Pyx_GIVEREF(__pyx_n_s_errors); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_errors); - __pyx_t_6 = __Pyx_Import(__pyx_n_s__36, __pyx_t_1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_6 = __Pyx_Import(__pyx_n_s__30, __pyx_t_1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) @@ -28025,10 +28093,10 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 2, NULL, NULL, &__pyx_slice__37, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 2, NULL, NULL, &__pyx_slice__31, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_tuple__38, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_tuple__32, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -28106,11 +28174,11 @@ if (!__Pyx_RefNanny) { * """Abstract container.""" * */ - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__43); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__37); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__43, __pyx_n_s_Container, __pyx_n_s_Container, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, __pyx_kp_s_Abstract_container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__37, __pyx_n_s_Container, __pyx_n_s_Container, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, __pyx_kp_s_Abstract_container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_Container, __pyx_tuple__43, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_Container, __pyx_tuple__37, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Container, __pyx_t_7) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -28152,7 +28220,7 @@ if (!__Pyx_RefNanny) { * """Initializer. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_1__init__, 0, __pyx_n_s_DynamicContainer___init, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_1__init__, 0, __pyx_n_s_DynamicContainer___init, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -28164,7 +28232,7 @@ if (!__Pyx_RefNanny) { * """Create and return full copy of container.""" * copied = memo.get(id(self)) */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_3__deepcopy__, 0, __pyx_n_s_DynamicContainer___deepcopy, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_3__deepcopy__, 0, __pyx_n_s_DynamicContainer___deepcopy, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_deepcopy_2, __pyx_t_9) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -28176,7 +28244,7 @@ if (!__Pyx_RefNanny) { * """Set instance attribute. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_5__setattr__, 0, __pyx_n_s_DynamicContainer___setattr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_5__setattr__, 0, __pyx_n_s_DynamicContainer___setattr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setattr, __pyx_t_9) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -28188,7 +28256,7 @@ if (!__Pyx_RefNanny) { * """Delete instance attribute. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_7__delattr__, 0, __pyx_n_s_DynamicContainer___delattr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_7__delattr__, 0, __pyx_n_s_DynamicContainer___delattr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_delattr, __pyx_t_9) < 0) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -28200,7 +28268,7 @@ if (!__Pyx_RefNanny) { * """Return dependency providers dictionary. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_9dependencies, 0, __pyx_n_s_DynamicContainer_dependencies, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_9dependencies, 0, __pyx_n_s_DynamicContainer_dependencies, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "dependency_injector/containers.pyx":147 @@ -28225,7 +28293,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_11traverse, 0, __pyx_n_s_DynamicContainer_traverse, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__55); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__49); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_traverse, __pyx_t_10) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28236,7 +28304,7 @@ if (!__Pyx_RefNanny) { * """Set container providers. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_14set_providers, 0, __pyx_n_s_DynamicContainer_set_providers, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_14set_providers, 0, __pyx_n_s_DynamicContainer_set_providers, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_set_providers, __pyx_t_10) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28248,7 +28316,7 @@ if (!__Pyx_RefNanny) { * """Set container provider. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_16set_provider, 0, __pyx_n_s_DynamicContainer_set_provider, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_16set_provider, 0, __pyx_n_s_DynamicContainer_set_provider, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_set_provider, __pyx_t_10) < 0) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28260,7 +28328,7 @@ if (!__Pyx_RefNanny) { * """Override current container by overriding container. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18override, 0, __pyx_n_s_DynamicContainer_override, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_18override, 0, __pyx_n_s_DynamicContainer_override, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_override, __pyx_t_10) < 0) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28272,7 +28340,7 @@ if (!__Pyx_RefNanny) { * """Override container providers. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_20override_providers, 0, __pyx_n_s_DynamicContainer_override_provid, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_20override_providers, 0, __pyx_n_s_DynamicContainer_override_provid, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_override_providers, __pyx_t_10) < 0) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28284,7 +28352,7 @@ if (!__Pyx_RefNanny) { * """Reset last overriding provider for each container providers. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_22reset_last_overriding, 0, __pyx_n_s_DynamicContainer_reset_last_over, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_22reset_last_overriding, 0, __pyx_n_s_DynamicContainer_reset_last_over, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_last_overriding, __pyx_t_10) < 0) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28296,7 +28364,7 @@ if (!__Pyx_RefNanny) { * """Reset all overridings for each container providers. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_24reset_override, 0, __pyx_n_s_DynamicContainer_reset_override, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_24reset_override, 0, __pyx_n_s_DynamicContainer_reset_override, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_override, __pyx_t_10) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28308,9 +28376,9 @@ if (!__Pyx_RefNanny) { * """Wire container providers with provided packages and modules. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_26wire, 0, __pyx_n_s_DynamicContainer_wire, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_26wire, 0, __pyx_n_s_DynamicContainer_wire, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__70); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__64); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_wire, __pyx_t_10) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28321,7 +28389,7 @@ if (!__Pyx_RefNanny) { * """Unwire container providers from previously wired packages and modules.""" * unwire( */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_28unwire, 0, __pyx_n_s_DynamicContainer_unwire, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_28unwire, 0, __pyx_n_s_DynamicContainer_unwire, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_unwire, __pyx_t_10) < 0) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28333,7 +28401,7 @@ if (!__Pyx_RefNanny) { * """Initialize all container resources.""" * futures = [] */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_30init_resources, 0, __pyx_n_s_DynamicContainer_init_resources, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_30init_resources, 0, __pyx_n_s_DynamicContainer_init_resources, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init_resources, __pyx_t_10) < 0) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -28343,131 +28411,131 @@ if (!__Pyx_RefNanny) { * * def shutdown_resources(self): # <<<<<<<<<<<<<< * """Shutdown all container resources.""" - * def _no_initialized_dependencies(resource): + * def _independent_resources(resources): */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_32shutdown_resources, 0, __pyx_n_s_DynamicContainer_shutdown_resour_9, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_32shutdown_resources, 0, __pyx_n_s_DynamicContainer_shutdown_resour_7, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_shutdown_resources, __pyx_t_10) < 0) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":334 + /* "dependency_injector/containers.pyx":329 * return _sync_ordered_shutdown(resources) * * def apply_container_providers_overridings(self): # <<<<<<<<<<<<<< * """Apply container providers' overridings.""" * for provider in self.traverse(types=[providers.Container]): */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_34apply_container_providers_overridings, 0, __pyx_n_s_DynamicContainer_apply_container, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_34apply_container_providers_overridings, 0, __pyx_n_s_DynamicContainer_apply_container, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_apply_container_providers_overri, __pyx_t_10) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_apply_container_providers_overri, __pyx_t_10) < 0) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":339 + /* "dependency_injector/containers.pyx":334 * provider.apply_overridings() * * def reset_singletons(self): # <<<<<<<<<<<<<< * """Reset container singletons.""" * for provider in self.traverse(types=[providers.BaseSingleton]): */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_36reset_singletons, 0, __pyx_n_s_DynamicContainer_reset_singleton, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_36reset_singletons, 0, __pyx_n_s_DynamicContainer_reset_singleton, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_singletons, __pyx_t_10) < 0) __PYX_ERR(0, 339, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_singletons, __pyx_t_10) < 0) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":345 + /* "dependency_injector/containers.pyx":340 * return SingletonResetContext(self) * * def check_dependencies(self): # <<<<<<<<<<<<<< * """Check if container dependencies are defined. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_38check_dependencies, 0, __pyx_n_s_DynamicContainer_check_dependenc, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_38check_dependencies, 0, __pyx_n_s_DynamicContainer_check_dependenc, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_check_dependencies, __pyx_t_10) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_check_dependencies, __pyx_t_10) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":369 + /* "dependency_injector/containers.pyx":364 * ) * * def from_schema(self, schema): # <<<<<<<<<<<<<< * """Build container providers from schema.""" * from .schema import build_schema */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_40from_schema, 0, __pyx_n_s_DynamicContainer_from_schema, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_40from_schema, 0, __pyx_n_s_DynamicContainer_from_schema, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_from_schema, __pyx_t_10) < 0) __PYX_ERR(0, 369, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_from_schema, __pyx_t_10) < 0) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":375 + /* "dependency_injector/containers.pyx":370 * self.set_provider(name, provider) * * def from_yaml_schema(self, filepath, loader=None): # <<<<<<<<<<<<<< * """Build container providers from YAML schema. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_42from_yaml_schema, 0, __pyx_n_s_DynamicContainer_from_yaml_schem, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_42from_yaml_schema, 0, __pyx_n_s_DynamicContainer_from_yaml_schem, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__87); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_from_yaml_schema, __pyx_t_10) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__81); + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_from_yaml_schema, __pyx_t_10) < 0) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":396 + /* "dependency_injector/containers.pyx":391 * self.from_schema(schema) * * def from_json_schema(self, filepath): # <<<<<<<<<<<<<< * """Build container providers from JSON schema.""" * with open(filepath) as file: */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_44from_json_schema, 0, __pyx_n_s_DynamicContainer_from_json_schem, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_44from_json_schema, 0, __pyx_n_s_DynamicContainer_from_json_schem, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_from_json_schema, __pyx_t_10) < 0) __PYX_ERR(0, 396, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_from_json_schema, __pyx_t_10) < 0) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":402 + /* "dependency_injector/containers.pyx":397 * self.from_schema(schema) * * def resolve_provider_name(self, provider): # <<<<<<<<<<<<<< * """Try to resolve provider name.""" * for provider_name, container_provider in self.providers.items(): */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_46resolve_provider_name, 0, __pyx_n_s_DynamicContainer_resolve_provide, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_46resolve_provider_name, 0, __pyx_n_s_DynamicContainer_resolve_provide, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_resolve_provider_name, __pyx_t_10) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_resolve_provider_name, __pyx_t_10) < 0) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":411 + /* "dependency_injector/containers.pyx":406 * * @property * def parent_name(self): # <<<<<<<<<<<<<< * """Return parent name.""" * if self.parent: */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_48parent_name, 0, __pyx_n_s_DynamicContainer_parent_name, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_48parent_name, 0, __pyx_n_s_DynamicContainer_parent_name, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - /* "dependency_injector/containers.pyx":410 + /* "dependency_injector/containers.pyx":405 * raise errors.Error(f'Can not resolve name for provider "{provider}"') * * @property # <<<<<<<<<<<<<< * def parent_name(self): * """Return parent name.""" */ - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_parent_name, __pyx_t_9) < 0) __PYX_ERR(0, 411, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_parent_name, __pyx_t_9) < 0) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":421 + /* "dependency_injector/containers.pyx":416 * return None * * def assign_parent(self, parent): # <<<<<<<<<<<<<< * """Assign parent.""" * self.parent = parent */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_50assign_parent, 0, __pyx_n_s_DynamicContainer_assign_parent, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_16DynamicContainer_50assign_parent, 0, __pyx_n_s_DynamicContainer_assign_parent, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_assign_parent, __pyx_t_9) < 0) __PYX_ERR(0, 421, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_assign_parent, __pyx_t_9) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "dependency_injector/containers.pyx":36 @@ -28485,197 +28553,197 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":426 + /* "dependency_injector/containers.pyx":421 * * * class DeclarativeContainerMetaClass(type): # <<<<<<<<<<<<<< * """Declarative inversion of control container meta class.""" * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)(&PyType_Type))); __Pyx_GIVEREF(((PyObject *)(&PyType_Type))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyType_Type))); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_DeclarativeContainerMetaClass_2, __pyx_n_s_DeclarativeContainerMetaClass_2, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, __pyx_kp_s_Declarative_inversion_of_control); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_DeclarativeContainerMetaClass_2, __pyx_n_s_DeclarativeContainerMetaClass_2, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, __pyx_kp_s_Declarative_inversion_of_control); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "dependency_injector/containers.pyx":429 + /* "dependency_injector/containers.pyx":424 * """Declarative inversion of control container meta class.""" * * def __new__(type mcs, str class_name, tuple bases, dict attributes): # <<<<<<<<<<<<<< * """Declarative container class factory.""" * self = mcs.__fetch_self(attributes) */ - __pyx_t_9 = __Pyx_CyFunction_New(&__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__97)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__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__91)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_new, __pyx_t_9) < 0) __PYX_ERR(0, 429, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_new, __pyx_t_9) < 0) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":477 + /* "dependency_injector/containers.pyx":472 * return cls * * def __setattr__(cls, str name, object value): # <<<<<<<<<<<<<< * """Set class attribute. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__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__99)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__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__93)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setattr, __pyx_t_9) < 0) __PYX_ERR(0, 477, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setattr, __pyx_t_9) < 0) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":501 + /* "dependency_injector/containers.pyx":496 * super(DeclarativeContainerMetaClass, cls).__setattr__(name, value) * * def __delattr__(cls, str name): # <<<<<<<<<<<<<< * """Delete class attribute. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__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__101)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__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__95)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_delattr, __pyx_t_9) < 0) __PYX_ERR(0, 501, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_delattr, __pyx_t_9) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":518 + /* "dependency_injector/containers.pyx":513 * * @property * def dependencies(cls): # <<<<<<<<<<<<<< * """Return dependency providers dictionary. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7dependencies, 0, __pyx_n_s_DeclarativeContainerMetaClass_de, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_7dependencies, 0, __pyx_n_s_DeclarativeContainerMetaClass_de, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "dependency_injector/containers.pyx":517 + /* "dependency_injector/containers.pyx":512 * super(DeclarativeContainerMetaClass, cls).__delattr__(name) * * @property # <<<<<<<<<<<<<< * def dependencies(cls): * """Return dependency providers dictionary. */ - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_dependencies, __pyx_t_10) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_dependencies, __pyx_t_10) < 0) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":533 + /* "dependency_injector/containers.pyx":528 * } * * def traverse(cls, types=None): # <<<<<<<<<<<<<< * """Return providers traversal generator.""" * yield from providers.traverse(*cls.providers.values(), types=types) */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_9traverse, 0, __pyx_n_s_DeclarativeContainerMetaClass_tr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_9traverse, 0, __pyx_n_s_DeclarativeContainerMetaClass_tr, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__105); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_traverse, __pyx_t_10) < 0) __PYX_ERR(0, 533, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__99); + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_traverse, __pyx_t_10) < 0) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":537 + /* "dependency_injector/containers.pyx":532 * yield from providers.traverse(*cls.providers.values(), types=types) * * def resolve_provider_name(cls, provider): # <<<<<<<<<<<<<< * """Try to resolve provider name.""" * for provider_name, container_provider in cls.providers.items(): */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_12resolve_provider_name, 0, __pyx_n_s_DeclarativeContainerMetaClass_re, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_12resolve_provider_name, 0, __pyx_n_s_DeclarativeContainerMetaClass_re, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_resolve_provider_name, __pyx_t_10) < 0) __PYX_ERR(0, 537, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_resolve_provider_name, __pyx_t_10) < 0) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":546 + /* "dependency_injector/containers.pyx":541 * * @property * def parent_name(cls): # <<<<<<<<<<<<<< * """Return parent name.""" * return cls.__name__ */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_14parent_name, 0, __pyx_n_s_DeclarativeContainerMetaClass_pa, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_14parent_name, 0, __pyx_n_s_DeclarativeContainerMetaClass_pa, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - /* "dependency_injector/containers.pyx":545 + /* "dependency_injector/containers.pyx":540 * raise errors.Error(f'Can not resolve name for provider "{provider}"') * * @property # <<<<<<<<<<<<<< * def parent_name(cls): * """Return parent name.""" */ - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_parent_name, __pyx_t_9) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_parent_name, __pyx_t_9) < 0) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":551 + /* "dependency_injector/containers.pyx":546 * * @staticmethod * def __fetch_self(attributes): # <<<<<<<<<<<<<< * self = None * alt_names = [] */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_16__fetch_self, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_DeclarativeContainerMetaClass_6, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_29DeclarativeContainerMetaClass_16__fetch_self, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_DeclarativeContainerMetaClass_6, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "dependency_injector/containers.pyx":550 + /* "dependency_injector/containers.pyx":545 * return cls.__name__ * * @staticmethod # <<<<<<<<<<<<<< * def __fetch_self(attributes): * self = None */ - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_DeclarativeContainerMetaClass, __pyx_t_10) < 0) __PYX_ERR(0, 551, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_DeclarativeContainerMetaClass, __pyx_t_10) < 0) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":426 + /* "dependency_injector/containers.pyx":421 * * * class DeclarativeContainerMetaClass(type): # <<<<<<<<<<<<<< * """Declarative inversion of control container meta class.""" * */ - __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_DeclarativeContainerMetaClass_2, __pyx_t_1, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_DeclarativeContainerMetaClass_2, __pyx_t_1, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeclarativeContainerMetaClass_2, __pyx_t_10) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeclarativeContainerMetaClass_2, __pyx_t_10) < 0) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":574 + /* "dependency_injector/containers.pyx":569 * * @six.add_metaclass(DeclarativeContainerMetaClass) * class DeclarativeContainer(Container): # <<<<<<<<<<<<<< * """Declarative inversion of control container. * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Container); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __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_7)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __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_7)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "dependency_injector/containers.pyx":585 + /* "dependency_injector/containers.pyx":580 * """ * * __IS_CONTAINER__ = True # <<<<<<<<<<<<<< * * provider_type = providers.Provider */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_IS_CONTAINER, Py_True) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_IS_CONTAINER, Py_True) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - /* "dependency_injector/containers.pyx":587 + /* "dependency_injector/containers.pyx":582 * __IS_CONTAINER__ = True * * provider_type = providers.Provider # <<<<<<<<<<<<<< @@ -28683,189 +28751,189 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_providers); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 587, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Provider); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Provider); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_provider_type, __pyx_t_9) < 0) __PYX_ERR(0, 587, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_provider_type, __pyx_t_9) < 0) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":593 + /* "dependency_injector/containers.pyx":588 * """ * * instance_type = DynamicContainer # <<<<<<<<<<<<<< * """Type of container that is returned on instantiating declarative * container. */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_DynamicContainer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_instance_type, __pyx_t_9) < 0) __PYX_ERR(0, 593, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_instance_type, __pyx_t_9) < 0) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":600 + /* "dependency_injector/containers.pyx":595 * """ * * containers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of all nested containers. * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_containers, __pyx_t_9) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_containers, __pyx_t_9) < 0) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":606 + /* "dependency_injector/containers.pyx":601 * """ * * providers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of all providers. * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_providers, __pyx_t_9) < 0) __PYX_ERR(0, 606, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_providers, __pyx_t_9) < 0) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":612 + /* "dependency_injector/containers.pyx":607 * """ * * cls_providers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of current container providers. * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_cls_providers, __pyx_t_9) < 0) __PYX_ERR(0, 612, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_cls_providers, __pyx_t_9) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":618 + /* "dependency_injector/containers.pyx":613 * """ * * inherited_providers = dict() # <<<<<<<<<<<<<< * """Read-only dictionary of inherited providers. * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_inherited_providers, __pyx_t_9) < 0) __PYX_ERR(0, 618, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_inherited_providers, __pyx_t_9) < 0) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":624 + /* "dependency_injector/containers.pyx":619 * """ * * overridden = tuple() # <<<<<<<<<<<<<< * """Tuple of overriding containers. * */ - __pyx_t_9 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_overridden, __pyx_t_9) < 0) __PYX_ERR(0, 624, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_overridden, __pyx_t_9) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":630 + /* "dependency_injector/containers.pyx":625 * """ * * __self__ = None # <<<<<<<<<<<<<< * """Provider that provides current container. * */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_self, Py_None) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_self, Py_None) < 0) __PYX_ERR(0, 625, __pyx_L1_error) - /* "dependency_injector/containers.pyx":636 + /* "dependency_injector/containers.pyx":631 * """ * * def __new__(cls, **overriding_providers): # <<<<<<<<<<<<<< * """Constructor. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__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__113)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__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__107)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_new, __pyx_t_9) < 0) __PYX_ERR(0, 636, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_new, __pyx_t_9) < 0) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":663 + /* "dependency_injector/containers.pyx":658 * * @classmethod * def override(cls, object overriding): # <<<<<<<<<<<<<< * """Override current container by overriding container. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__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__115)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__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__109)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "dependency_injector/containers.pyx":662 + /* "dependency_injector/containers.pyx":657 * return container * * @classmethod # <<<<<<<<<<<<<< * def override(cls, object overriding): * """Override current container by overriding container. */ - __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_override, __pyx_t_10) < 0) __PYX_ERR(0, 663, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_override, __pyx_t_10) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":687 + /* "dependency_injector/containers.pyx":682 * * @classmethod * def reset_last_overriding(cls): # <<<<<<<<<<<<<< * """Reset last overriding provider for each container providers. * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__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__117)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__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__111)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - /* "dependency_injector/containers.pyx":686 + /* "dependency_injector/containers.pyx":681 * pass * * @classmethod # <<<<<<<<<<<<<< * def reset_last_overriding(cls): * """Reset last overriding provider for each container providers. */ - __pyx_t_9 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_t_9 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_last_overriding, __pyx_t_9) < 0) __PYX_ERR(0, 687, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_last_overriding, __pyx_t_9) < 0) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dependency_injector/containers.pyx":701 + /* "dependency_injector/containers.pyx":696 * * @classmethod * def reset_override(cls): # <<<<<<<<<<<<<< * """Reset all overridings for each container providers. * */ - __pyx_t_9 = __Pyx_CyFunction_New(&__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__119)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__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__113)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "dependency_injector/containers.pyx":700 + /* "dependency_injector/containers.pyx":695 * provider.reset_last_overriding() * * @classmethod # <<<<<<<<<<<<<< * def reset_override(cls): * """Reset all overridings for each container providers. */ - __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_override, __pyx_t_10) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset_override, __pyx_t_10) < 0) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dependency_injector/containers.pyx":573 + /* "dependency_injector/containers.pyx":568 * * * @six.add_metaclass(DeclarativeContainerMetaClass) # <<<<<<<<<<<<<< * class DeclarativeContainer(Container): * """Declarative inversion of control container. */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_six); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_six); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_add_metaclass); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_add_metaclass); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_DeclarativeContainerMetaClass_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { @@ -28880,18 +28948,18 @@ if (!__Pyx_RefNanny) { __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "dependency_injector/containers.pyx":574 + /* "dependency_injector/containers.pyx":569 * * @six.add_metaclass(DeclarativeContainerMetaClass) * class DeclarativeContainer(Container): # <<<<<<<<<<<<<< * """Declarative inversion of control container. * */ - __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DeclarativeContainer, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DeclarativeContainer, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { @@ -28906,96 +28974,96 @@ if (!__Pyx_RefNanny) { __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeclarativeContainer, __pyx_t_10) < 0) __PYX_ERR(0, 574, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeclarativeContainer, __pyx_t_10) < 0) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":712 + /* "dependency_injector/containers.pyx":707 * * * class SingletonResetContext: # <<<<<<<<<<<<<< * * def __init__(self, container): */ - __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_SingletonResetContext, __pyx_n_s_SingletonResetContext, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_SingletonResetContext, __pyx_n_s_SingletonResetContext, (PyObject *) NULL, __pyx_n_s_dependency_injector_containers, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "dependency_injector/containers.pyx":714 + /* "dependency_injector/containers.pyx":709 * class SingletonResetContext: * * def __init__(self, container): # <<<<<<<<<<<<<< * self._container = container * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_21SingletonResetContext_1__init__, 0, __pyx_n_s_SingletonResetContext___init, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_21SingletonResetContext_1__init__, 0, __pyx_n_s_SingletonResetContext___init, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 714, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":717 + /* "dependency_injector/containers.pyx":712 * self._container = container * * def __enter__(self): # <<<<<<<<<<<<<< * return self._container * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_21SingletonResetContext_3__enter__, 0, __pyx_n_s_SingletonResetContext___enter, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_21SingletonResetContext_3__enter__, 0, __pyx_n_s_SingletonResetContext___enter, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":720 + /* "dependency_injector/containers.pyx":715 * return self._container * * def __exit__(self, *_): # <<<<<<<<<<<<<< * self._container.reset_singletons() * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_21SingletonResetContext_5__exit__, 0, __pyx_n_s_SingletonResetContext___exit, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_19dependency_injector_10containers_21SingletonResetContext_5__exit__, 0, __pyx_n_s_SingletonResetContext___exit, NULL, __pyx_n_s_dependency_injector_containers, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 720, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dependency_injector/containers.pyx":712 + /* "dependency_injector/containers.pyx":707 * * * class SingletonResetContext: # <<<<<<<<<<<<<< * * def __init__(self, container): */ - __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_SingletonResetContext, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_SingletonResetContext, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SingletonResetContext, __pyx_t_1) < 0) __PYX_ERR(0, 712, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SingletonResetContext, __pyx_t_1) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":724 + /* "dependency_injector/containers.pyx":719 * * * def override(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` overriding decorator. * */ - __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_5override, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_5override, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_override, __pyx_t_6) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_override, __pyx_t_6) < 0) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dependency_injector/containers.pyx":741 + /* "dependency_injector/containers.pyx":736 * * * def copy(object container): # <<<<<<<<<<<<<< * """:py:class:`DeclarativeContainer` copying decorator. * */ - __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_7copy, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_10containers_7copy, NULL, __pyx_n_s_dependency_injector_containers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 741, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "dependency_injector/containers.pyx":1 diff --git a/src/dependency_injector/containers.pyx b/src/dependency_injector/containers.pyx index c6df001f..2b1c6b00 100644 --- a/src/dependency_injector/containers.pyx +++ b/src/dependency_injector/containers.pyx @@ -290,24 +290,19 @@ class DynamicContainer(Container): def shutdown_resources(self): """Shutdown all container resources.""" - def _no_initialized_dependencies(resource): - for related in resource.related: - if isinstance(related, providers.Resource) and related.initialized: - return False - return True - - def _without_initialized_dependencies(resources): - return list(filter(_no_initialized_dependencies, resources)) - - def _any_initialized(resources): - return any(resource.initialized for resource in resources) - - def _any_in_async_mode(resources): - return any(resource.is_async_mode_enabled() for resource in resources) + def _independent_resources(resources): + for resource in resources: + for other_resource in resources: + if not other_resource.initialized: + continue + if resource in other_resource.related: + break + else: + yield resource async def _async_ordered_shutdown(resources): - while _any_initialized(resources): - resources_to_shutdown = _without_initialized_dependencies(resources) + while any(resource.initialized for resource in resources): + resources_to_shutdown = list(_independent_resources(resources)) if not resources_to_shutdown: raise RuntimeError('Unable to resolve resources shutdown order') futures = [] @@ -318,15 +313,15 @@ class DynamicContainer(Container): await asyncio.gather(*futures) def _sync_ordered_shutdown(resources): - while _any_initialized(resources): - resources_to_shutdown = _without_initialized_dependencies(resources) + while any(resource.initialized for resource in resources): + resources_to_shutdown = list(_independent_resources(resources)) if not resources_to_shutdown: raise RuntimeError('Unable to resolve resources shutdown order') for resource in resources_to_shutdown: resource.shutdown() resources = list(self.traverse(types=[providers.Resource])) - if _any_in_async_mode(resources): + if any(resource.is_async_mode_enabled() for resource in resources): return _async_ordered_shutdown(resources) else: return _sync_ordered_shutdown(resources) diff --git a/tests/unit/containers/test_dynamic_async_resources_py36.py b/tests/unit/containers/test_dynamic_async_resources_py36.py index 36cadd3c..12cec831 100644 --- a/tests/unit/containers/test_dynamic_async_resources_py36.py +++ b/tests/unit/containers/test_dynamic_async_resources_py36.py @@ -70,15 +70,15 @@ class AsyncResourcesTest(AsyncTestCase): self._run(container.shutdown_resources()) self.assertEqual(initialized_resources, ['r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1']) self._run(container.init_resources()) self.assertEqual(initialized_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1']) self._run(container.shutdown_resources()) self.assertEqual(initialized_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1', 'r3', 'r2', 'r1']) def test_shutdown_circular_dependencies_breaker(self): async def _resource(name, **_): @@ -148,12 +148,12 @@ class AsyncResourcesTest(AsyncTestCase): self._run(container.shutdown_resources()) self.assertEqual(initialized_resources, ['r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1']) self._run(container.init_resources()) self.assertEqual(initialized_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1']) self._run(container.shutdown_resources()) self.assertEqual(initialized_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1', 'r3', 'r2', 'r1']) diff --git a/tests/unit/containers/test_dynamic_py2_py3.py b/tests/unit/containers/test_dynamic_py2_py3.py index fea4d489..bfcf766a 100644 --- a/tests/unit/containers/test_dynamic_py2_py3.py +++ b/tests/unit/containers/test_dynamic_py2_py3.py @@ -233,15 +233,15 @@ class DeclarativeContainerInstanceTests(unittest.TestCase): container.shutdown_resources() self.assertEqual(initialized_resources, ['r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1']) container.init_resources() self.assertEqual(initialized_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1']) container.shutdown_resources() self.assertEqual(initialized_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) - self.assertEqual(shutdown_resources, ['r1', 'r2', 'r3', 'r1', 'r2', 'r3']) + self.assertEqual(shutdown_resources, ['r3', 'r2', 'r1', 'r3', 'r2', 'r1']) def test_shutdown_resources_circular_dependencies_breaker(self): def _resource(name, **_):