summaryrefslogtreecommitdiffstats
path: root/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py
blob: f2c07a0c7cc7a4681650424f6135f0598ac934b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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