diff options
Diffstat (limited to 'sphinx/ext/autodoc/deprecated.py')
-rw-r--r-- | sphinx/ext/autodoc/deprecated.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sphinx/ext/autodoc/deprecated.py b/sphinx/ext/autodoc/deprecated.py index c6ca13105..5541a7a91 100644 --- a/sphinx/ext/autodoc/deprecated.py +++ b/sphinx/ext/autodoc/deprecated.py @@ -109,3 +109,18 @@ class SlotsAttributeDocumenter(AttributeDocumenter): warnings.warn("%s is deprecated." % self.__class__.__name__, RemovedInSphinx50Warning, stacklevel=2) super().__init__(*args, **kwargs) + + +class GenericAliasDocumenter(DataDocumenter): + """ + Specialized Documenter subclass for GenericAliases. + """ + + objtype = 'genericalias' + directivetype = 'data' + priority = DataDocumenter.priority + 1 # type: ignore + + def __init__(self, *args: Any, **kwargs: Any) -> None: + warnings.warn("%s is deprecated." % self.__class__.__name__, + RemovedInSphinx50Warning, stacklevel=2) + super().__init__(*args, **kwargs) |