From cf7da1843c45a4c2df7a749f7886a2d2ba0ee92a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:25:40 +0200 Subject: Adding upstream version 7.2.6. Signed-off-by: Daniel Baumann --- .../target/autodoc_type_aliases.py | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py (limited to 'tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py') diff --git a/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py b/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py new file mode 100644 index 0000000..f2c07a0 --- /dev/null +++ b/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py @@ -0,0 +1,49 @@ +from __future__ import annotations + +import io +from typing import Optional, overload + +myint = int + +#: docstring +variable: myint + +#: docstring +variable2 = None # type: myint + +#: docstring +variable3: Optional[myint] + + +def read(r: io.BytesIO) -> io.StringIO: + """docstring""" + + +def sum(x: myint, y: myint) -> myint: + """docstring""" + return x + y + + +@overload +def mult(x: myint, y: myint) -> myint: + ... + + +@overload +def mult(x: float, y: float) -> float: + ... + + +def mult(x, y): + """docstring""" + return x, y + + +class Foo: + """docstring""" + + #: docstring + attr1: myint + + def __init__(self): + self.attr2: myint = None #: docstring -- cgit v1.2.3