Skip to content

Commit 37dd008

Browse files
missing file
1 parent 7b80c7d commit 37dd008

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import warnings
2+
import functools
3+
4+
def deprecated(reason):
5+
def decorator(cls):
6+
@functools.wraps(cls)
7+
def new_cls(*args, **kwargs):
8+
warnings.warn(f"{cls.__name__} is deprecated: {reason}", category=DeprecationWarning, stacklevel=2)
9+
return cls(*args, **kwargs)
10+
return new_cls
11+
return decorator

0 commit comments

Comments
 (0)