diff options
Diffstat (limited to 'tests/roots/test-ext-autodoc/target/annotations.py')
-rw-r--r-- | tests/roots/test-ext-autodoc/target/annotations.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/roots/test-ext-autodoc/target/annotations.py b/tests/roots/test-ext-autodoc/target/annotations.py new file mode 100644 index 000000000..ef600e2af --- /dev/null +++ b/tests/roots/test-ext-autodoc/target/annotations.py @@ -0,0 +1,41 @@ +from __future__ import annotations + +from typing import overload + +myint = int + +#: docstring +variable: myint + +#: docstring +variable2 = None # type: myint + + +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 |