From 7837d0222bd193998c27d12d6ea6a24a9a29fd10 Mon Sep 17 00:00:00 2001 From: Aldo Mateli Date: Tue, 7 May 2024 22:50:38 +0100 Subject: [PATCH] Revert "Deprecate usage of default values" This reverts commit 49e7f304f25e0b72e569987cb644e2bc7e2e2eb5. --- wireup/ioc/util.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/wireup/ioc/util.py b/wireup/ioc/util.py index dbd3085..da4661b 100644 --- a/wireup/ioc/util.py +++ b/wireup/ioc/util.py @@ -1,7 +1,6 @@ from __future__ import annotations import typing -import warnings from inspect import Parameter from typing import Any @@ -34,11 +33,6 @@ def _get_metadata_from_annotated_type(parameter: Parameter) -> AnnotatedParamete def _get_metadata_from_default_value(parameter: Parameter) -> AnnotatedParameter | None: - warnings.warn( - "Using default values to annotate parameters for injection is deprecated. " - "Use annotated types. E.g.: Annotated[str, Wire(...)]", - stacklevel=2, - ) klass = None if parameter.annotation is Parameter.empty else parameter.annotation annotation = None if parameter.default is Parameter.empty else _get_injectable_type(parameter.default)