sphinx/tests/roots/test-ext-autodoc/target/classes.py
Takeshi KOMIYA 6c645e41f8 refactor: Deprecate no_docstring argument for Documenter.add_content()
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.
2020-12-26 21:14:26 +09:00

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