-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
featureNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
My project has a module where I switch between the stdlib and typing_extensions depending on the version of Python in use. It looks something like:
myproject/compat.py:
__all__ = [
"deprecated",
]
if sys.version_info >= (3, 13):
from warnings import deprecated
else:
from typing_extensions import deprecatedThen in the rest of the project I do:
from myproject.compat import deprecated
@deprecate("this is deprecated")
def foo():
passHowever, it seems this isn't recognized as the deprecated decorator because the decorator.callable_path is myproject.compat.deprecated.
Describe the solution you'd like
Maybe we could allow setting custom paths for the decorators? Maybe support any decorator with the function name deprecated (seems risky)? I'd rather not have to remove the compat module though or do the if/else outside of my compat.py where the decorator is used.
Describe alternatives you've considered
None
Additional context
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request