From 21dcb93ece7a2cbd4e1275fad758f746f6178d81 Mon Sep 17 00:00:00 2001 From: Niklas Neugebauer Date: Wed, 22 Jan 2025 16:49:45 +0100 Subject: [PATCH] remove class deprecation decorator --- rosys/helpers/deprecation.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/rosys/helpers/deprecation.py b/rosys/helpers/deprecation.py index 82db8e52..eec356c8 100644 --- a/rosys/helpers/deprecation.py +++ b/rosys/helpers/deprecation.py @@ -35,21 +35,3 @@ def wrapper(*args, **kwargs): return wrapper return decorator - -def deprecated_class(*, remove_in_version: str | None = None, stacklevel: int = 2) -> Callable: - """Mark a class as deprecated.""" - def decorator(cls: type) -> type: - original_init = cls.__init__ - - def new_init(self, *args, **kwargs): - warnings.warn( - f'The class "{cls.__name__}" is deprecated and will be removed in ' - f'{("RoSys " + remove_in_version) if remove_in_version else "a future version"}.', - category=DeprecationWarning, - stacklevel=stacklevel, - ) - original_init(self, *args, **kwargs) - - cls.__init__ = new_init - return cls - return decorator