-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_docstrings.pyi
More file actions
88 lines (77 loc) · 2.6 KB
/
_docstrings.pyi
File metadata and controls
88 lines (77 loc) · 2.6 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File generated with docstub
import logging
import traceback
import warnings
from collections.abc import Generator, Iterable
from dataclasses import dataclass, field
from functools import cached_property
import click
import lark
import lark.visitors
import numpydoc.docscrape as npds
from ._analysis import PyImport, TypeMatcher
from ._doctype import BlacklistedQualname, Expr, Term, TermKind, parse_doctype
from ._report import ContextReporter, Stats
from ._utils import escape_qualname
logger: logging.Logger
def _update_qualnames(
expr: Expr, *, _parents: tuple[Expr, ...] = ...
) -> Generator[tuple[tuple[Expr, ...], Term], str]: ...
@dataclass(frozen=True, slots=True, kw_only=True)
class Annotation:
value: str
imports: frozenset[PyImport] = ...
def __post_init__(self) -> None: ...
def __str__(self) -> str: ...
@classmethod
def many_as_tuple(cls, types: Iterable[Annotation]) -> Annotation: ...
@classmethod
def as_generator(
cls,
*,
yield_types: Iterable[Annotation],
receive_types: Iterable[Annotation] = ...,
return_types: Iterable[Annotation] = ...,
) -> Annotation: ...
def as_union_with_none(self) -> Annotation: ...
@staticmethod
def _aggregate_annotations(
*types: Iterable[Annotation],
) -> tuple[list[str], set[PyImport]]: ...
FallbackAnnotation: Annotation
def _uncombine_numpydoc_params(
params: list[npds.Parameter],
) -> Generator[npds.Parameter]: ...
def _red_partial_underline(doctype: str, *, start: int, stop: int) -> str: ...
def doctype_to_annotation(
doctype: str,
*,
matcher: TypeMatcher | None = ...,
reporter: ContextReporter | None = ...,
stats: Stats | None = ...,
) -> Annotation: ...
class DocstringAnnotations:
docstring: str
matcher: TypeMatcher
reporter: ContextReporter
def __init__(
self,
docstring: str,
*,
matcher: TypeMatcher | None = ...,
reporter: ContextReporter | None = ...,
stats: Stats | None = ...,
) -> None: ...
@cached_property
def attributes(self) -> dict[str, Annotation]: ...
@cached_property
def parameters(self) -> dict[str, Annotation]: ...
@cached_property
def returns(self) -> Annotation | None: ...
@cached_property
def _returns(self) -> Annotation | None: ...
@cached_property
def _yields(self) -> Annotation | None: ...
def _handle_missing_whitespace(self, param: npds.Parameter) -> npds.Parameter: ...
def _section_annotations(self, name: str) -> dict[str, Annotation]: ...
def _find_docstring_line(self, *substrings: str) -> int: ...