mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate `no_docstring` argument for `Documenter.add_content()` again. At the first trial (#8533), it changes the behavior of `autodoc-process-docstring` event; it is emitted unexpectedly for an alias of class. But it brings an incompatible change to extensions. Hence it was partially reverted at #8581. This keeps not calling the event for an alias of class. To do that, now `Documenter.get_doc()` can return None value.
33 lines
558 B
Python
33 lines
558 B
Python
from inspect import Parameter, Signature
|
|
from typing import List, Union
|
|
|
|
|
|
class Foo:
|
|
pass
|
|
|
|
|
|
class Bar:
|
|
def __init__(self, x, y):
|
|
pass
|
|
|
|
|
|
class Baz:
|
|
def __new__(cls, x, y):
|
|
pass
|
|
|
|
|
|
class Qux:
|
|
__signature__ = Signature(parameters=[Parameter('foo', Parameter.POSITIONAL_OR_KEYWORD),
|
|
Parameter('bar', Parameter.POSITIONAL_OR_KEYWORD)])
|
|
|
|
def __init__(self, x, y):
|
|
pass
|
|
|
|
|
|
class Quux(List[Union[int, float]]):
|
|
"""A subclass of List[Union[int, float]]"""
|
|
pass
|
|
|
|
|
|
Alias = Foo
|