mirror of
https://github.com/readthedocs/sphinx-autoapi
synced 2024-11-10 01:10:27 +00:00
parent
73bb2d6105
commit
24109875e1
@ -13,6 +13,12 @@ Features
|
||||
so that Sphinx can link to them.
|
||||
* Added support for Sphinx 3.3. and 3.4.
|
||||
|
||||
Bug Fixes
|
||||
^^^^^^^^^
|
||||
|
||||
* `#260 <https://github.com/readthedocs/sphinx-autoapi/issues/260>`:
|
||||
The overload signatures of ``__init__`` methods are documented.
|
||||
|
||||
|
||||
V1.6.0 (2021-01-20)
|
||||
-------------------
|
||||
@ -54,6 +60,7 @@ V1.5.1 (2020-10-01)
|
||||
|
||||
Bug Fixes
|
||||
^^^^^^^^^
|
||||
|
||||
* Fixed AttributeError when generating an inheritance diagram for a module.
|
||||
|
||||
|
||||
|
@ -1,5 +1,12 @@
|
||||
{% if obj.display %}
|
||||
.. py:{{ obj.type }}:: {{ obj.short_name }}{% if obj.args %}({{ obj.args }}){% endif %}
|
||||
.. {{ obj.type }}:: {{ obj.short_name }}{% if obj.args %}({{ obj.args }}){% endif %}
|
||||
{% if obj.constructor %}
|
||||
|
||||
{% for (args, return_annotation) in obj.constructor.overloads %}
|
||||
{% if args and args.startswith("self, ") %}{% set args = args[6:] %}{% endif %}
|
||||
{{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if obj.bases %}
|
||||
|
@ -126,6 +126,19 @@ class A:
|
||||
return a * 2
|
||||
|
||||
|
||||
class C:
|
||||
@overload
|
||||
def __init__(self, a: int) -> None:
|
||||
...
|
||||
|
||||
@typing.overload
|
||||
def __init__(self, a: float) -> None:
|
||||
...
|
||||
|
||||
def __init__(self, a: str):
|
||||
...
|
||||
|
||||
|
||||
async def async_function(wait: bool) -> int:
|
||||
"""Blah.
|
||||
|
||||
|
@ -219,6 +219,13 @@ class TestPy3Module(object):
|
||||
assert "undoc_overloaded_func" in example_file
|
||||
assert "undoc_overloaded_method" in example_file
|
||||
|
||||
assert "C(a: int" in example_file
|
||||
assert "C(a: float" in example_file
|
||||
assert "C(a: str" not in example_file
|
||||
assert "C(self, a: int" not in example_file
|
||||
assert "C(self, a: float" not in example_file
|
||||
assert "C(self, a: str" not in example_file
|
||||
|
||||
def test_async(self):
|
||||
example_path = "_build/text/autoapi/example/index.txt"
|
||||
with io.open(example_path, encoding="utf8") as example_handle:
|
||||
|
Loading…
Reference in New Issue
Block a user