mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 04:11:28 +08:00
Add fixers to lib2to3 (#10003)
This commit is contained in:
0
stdlib/lib2to3/fixes/__init__.pyi
Normal file
0
stdlib/lib2to3/fixes/__init__.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_apply.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_apply.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixApply(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
11
stdlib/lib2to3/fixes/fix_asserts.pyi
Normal file
11
stdlib/lib2to3/fixes/fix_asserts.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..fixer_base import BaseFix
|
||||
|
||||
NAMES: dict[str, str]
|
||||
|
||||
class FixAsserts(BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_basestring.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_basestring.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixBasestring(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[Literal["'basestring'"]]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_buffer.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_buffer.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixBuffer(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
17
stdlib/lib2to3/fixes/fix_dict.pyi
Normal file
17
stdlib/lib2to3/fixes/fix_dict.pyi
Normal file
@@ -0,0 +1,17 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
iter_exempt: set[str]
|
||||
|
||||
class FixDict(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
P1: ClassVar[str]
|
||||
p1: ClassVar[Incomplete]
|
||||
P2: ClassVar[str]
|
||||
p2: ClassVar[Incomplete]
|
||||
def in_special_context(self, node, isiter): ...
|
||||
15
stdlib/lib2to3/fixes/fix_except.pyi
Normal file
15
stdlib/lib2to3/fixes/fix_except.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from collections.abc import Generator, Iterable
|
||||
from typing import ClassVar, TypeVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Base
|
||||
|
||||
_N = TypeVar("_N", bound=Base)
|
||||
|
||||
def find_excepts(nodes: Iterable[_N]) -> Generator[tuple[_N, _N], None, None]: ...
|
||||
|
||||
class FixExcept(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_exec.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_exec.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixExec(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_execfile.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_execfile.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixExecfile(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
14
stdlib/lib2to3/fixes/fix_exitfunc.pyi
Normal file
14
stdlib/lib2to3/fixes/fix_exitfunc.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from _typeshed import Incomplete, StrPath
|
||||
from lib2to3 import fixer_base
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..pytree import Node
|
||||
|
||||
class FixExitfunc(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def __init__(self, *args) -> None: ...
|
||||
sys_import: Incomplete | None
|
||||
def start_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def transform(self, node, results) -> None: ...
|
||||
10
stdlib/lib2to3/fixes/fix_filter.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_filter.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixFilter(fixer_base.ConditionalFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
skip_on: ClassVar[Literal["future_builtins.filter"]]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_funcattrs.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_funcattrs.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixFuncattrs(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_future.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_future.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixFuture(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_getcwdu.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_getcwdu.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixGetcwdu(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_has_key.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_has_key.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixHasKey(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
16
stdlib/lib2to3/fixes/fix_idioms.pyi
Normal file
16
stdlib/lib2to3/fixes/fix_idioms.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
CMP: str
|
||||
TYPE: str
|
||||
|
||||
class FixIdioms(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
PATTERN: ClassVar[str]
|
||||
def match(self, node): ...
|
||||
def transform(self, node, results): ...
|
||||
def transform_isinstance(self, node, results): ...
|
||||
def transform_while(self, node, results) -> None: ...
|
||||
def transform_sort(self, node, results) -> None: ...
|
||||
17
stdlib/lib2to3/fixes/fix_import.pyi
Normal file
17
stdlib/lib2to3/fixes/fix_import.pyi
Normal file
@@ -0,0 +1,17 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Generator
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Node
|
||||
|
||||
def traverse_imports(names) -> Generator[str, None, None]: ...
|
||||
|
||||
class FixImport(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
skip: bool
|
||||
def start_tree(self, tree: Node, name: StrPath) -> None: ...
|
||||
def transform(self, node, results): ...
|
||||
def probably_a_local_import(self, imp_name): ...
|
||||
22
stdlib/lib2to3/fixes/fix_imports.pyi
Normal file
22
stdlib/lib2to3/fixes/fix_imports.pyi
Normal file
@@ -0,0 +1,22 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Generator
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Node
|
||||
|
||||
MAPPING: dict[str, str]
|
||||
|
||||
def alternates(members): ...
|
||||
def build_pattern(mapping=...) -> Generator[str, None, None]: ...
|
||||
|
||||
class FixImports(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
mapping = MAPPING # noqa: F821
|
||||
def build_pattern(self): ...
|
||||
def compile_pattern(self) -> None: ...
|
||||
def match(self, node): ...
|
||||
replace: dict[str, str]
|
||||
def start_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def transform(self, node, results) -> None: ...
|
||||
6
stdlib/lib2to3/fixes/fix_imports2.pyi
Normal file
6
stdlib/lib2to3/fixes/fix_imports2.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from . import fix_imports
|
||||
|
||||
MAPPING: dict[str, str]
|
||||
|
||||
class FixImports2(fix_imports.FixImports):
|
||||
mapping = MAPPING # noqa: F821
|
||||
12
stdlib/lib2to3/fixes/fix_input.pyi
Normal file
12
stdlib/lib2to3/fixes/fix_input.pyi
Normal file
@@ -0,0 +1,12 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
context: Incomplete
|
||||
|
||||
class FixInput(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
10
stdlib/lib2to3/fixes/fix_intern.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_intern.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixIntern(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
order: ClassVar[Literal["pre"]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_isinstance.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_isinstance.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixIsinstance(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
10
stdlib/lib2to3/fixes/fix_itertools.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_itertools.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixItertools(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
it_funcs: str
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
8
stdlib/lib2to3/fixes/fix_itertools_imports.pyi
Normal file
8
stdlib/lib2to3/fixes/fix_itertools_imports.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from lib2to3 import fixer_base
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
class FixItertoolsImports(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
8
stdlib/lib2to3/fixes/fix_long.pyi
Normal file
8
stdlib/lib2to3/fixes/fix_long.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from lib2to3 import fixer_base
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
class FixLong(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[Literal["'long'"]]
|
||||
def transform(self, node, results) -> None: ...
|
||||
10
stdlib/lib2to3/fixes/fix_map.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_map.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixMap(fixer_base.ConditionalFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
skip_on: ClassVar[Literal["future_builtins.map"]]
|
||||
def transform(self, node, results): ...
|
||||
18
stdlib/lib2to3/fixes/fix_metaclass.pyi
Normal file
18
stdlib/lib2to3/fixes/fix_metaclass.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from collections.abc import Generator
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Base
|
||||
|
||||
def has_metaclass(parent): ...
|
||||
def fixup_parse_tree(cls_node) -> None: ...
|
||||
def fixup_simple_stmt(parent, i, stmt_node) -> None: ...
|
||||
def remove_trailing_newline(node) -> None: ...
|
||||
def find_metas(cls_node) -> Generator[tuple[Base, int, Base], None, None]: ...
|
||||
def fixup_indent(suite) -> None: ...
|
||||
|
||||
class FixMetaclass(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
11
stdlib/lib2to3/fixes/fix_methodattrs.pyi
Normal file
11
stdlib/lib2to3/fixes/fix_methodattrs.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
MAP: dict[str, str]
|
||||
|
||||
class FixMethodattrs(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_ne.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_ne.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixNe(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
def match(self, node): ...
|
||||
def transform(self, node, results): ...
|
||||
20
stdlib/lib2to3/fixes/fix_next.pyi
Normal file
20
stdlib/lib2to3/fixes/fix_next.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Node
|
||||
|
||||
bind_warning: str
|
||||
|
||||
class FixNext(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
order: ClassVar[Literal["pre"]]
|
||||
shadowed_next: bool
|
||||
def start_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def transform(self, node, results) -> None: ...
|
||||
|
||||
def is_assign_target(node): ...
|
||||
def find_assign(node): ...
|
||||
def is_subtree(root, node): ...
|
||||
9
stdlib/lib2to3/fixes/fix_nonzero.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_nonzero.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixNonzero(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_numliterals.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_numliterals.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixNumliterals(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
def match(self, node): ...
|
||||
def transform(self, node, results): ...
|
||||
13
stdlib/lib2to3/fixes/fix_operator.pyi
Normal file
13
stdlib/lib2to3/fixes/fix_operator.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from lib2to3 import fixer_base
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
def invocation(s): ...
|
||||
|
||||
class FixOperator(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
order: ClassVar[Literal["pre"]]
|
||||
methods: str
|
||||
obj: str
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_paren.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_paren.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixParen(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
13
stdlib/lib2to3/fixes/fix_print.pyi
Normal file
13
stdlib/lib2to3/fixes/fix_print.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
parend_expr: Incomplete
|
||||
|
||||
class FixPrint(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
def add_kwarg(self, l_nodes, s_kwd, n_expr) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_raise.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_raise.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixRaise(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_raw_input.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_raw_input.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixRawInput(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_reduce.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_reduce.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from lib2to3 import fixer_base
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
class FixReduce(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
order: ClassVar[Literal["pre"]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
10
stdlib/lib2to3/fixes/fix_reload.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_reload.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixReload(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
order: ClassVar[Literal["pre"]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
18
stdlib/lib2to3/fixes/fix_renames.pyi
Normal file
18
stdlib/lib2to3/fixes/fix_renames.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from collections.abc import Generator
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
MAPPING: dict[str, dict[str, str]]
|
||||
LOOKUP: dict[tuple[str, str], str]
|
||||
|
||||
def alternates(members): ...
|
||||
def build_pattern() -> Generator[str, None, None]: ...
|
||||
|
||||
class FixRenames(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
order: ClassVar[Literal["pre"]]
|
||||
PATTERN: ClassVar[str]
|
||||
def match(self, node): ...
|
||||
def transform(self, node, results) -> None: ...
|
||||
9
stdlib/lib2to3/fixes/fix_repr.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_repr.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixRepr(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
8
stdlib/lib2to3/fixes/fix_set_literal.pyi
Normal file
8
stdlib/lib2to3/fixes/fix_set_literal.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from lib2to3 import fixer_base
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
class FixSetLiteral(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_standarderror.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_standarderror.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixStandarderror(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
10
stdlib/lib2to3/fixes/fix_sys_exc.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_sys_exc.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixSysExc(fixer_base.BaseFix):
|
||||
exc_info: ClassVar[list[str]]
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
9
stdlib/lib2to3/fixes/fix_throw.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_throw.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixThrow(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
18
stdlib/lib2to3/fixes/fix_tuple_params.pyi
Normal file
18
stdlib/lib2to3/fixes/fix_tuple_params.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
def is_docstring(stmt): ...
|
||||
|
||||
class FixTupleParams(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
def transform_lambda(self, node, results) -> None: ...
|
||||
|
||||
def simplify_args(node): ...
|
||||
def find_params(node): ...
|
||||
def map_to_index(param_list, prefix=..., d: Incomplete | None = ...): ...
|
||||
def tuple_name(param_list): ...
|
||||
9
stdlib/lib2to3/fixes/fix_types.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_types.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixTypes(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results): ...
|
||||
13
stdlib/lib2to3/fixes/fix_unicode.pyi
Normal file
13
stdlib/lib2to3/fixes/fix_unicode.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Node
|
||||
|
||||
class FixUnicode(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[Literal["STRING | 'unicode' | 'unichr'"]] # type: ignore[name-defined] # Name "STRING" is not defined
|
||||
unicode_literals: bool
|
||||
def start_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def transform(self, node, results): ...
|
||||
15
stdlib/lib2to3/fixes/fix_urllib.pyi
Normal file
15
stdlib/lib2to3/fixes/fix_urllib.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from collections.abc import Generator
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .fix_imports import FixImports
|
||||
|
||||
MAPPING: dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]
|
||||
|
||||
def build_pattern() -> Generator[str, None, None]: ...
|
||||
|
||||
class FixUrllib(FixImports):
|
||||
def build_pattern(self): ...
|
||||
def transform_import(self, node, results) -> None: ...
|
||||
def transform_member(self, node, results): ...
|
||||
def transform_dot(self, node, results) -> None: ...
|
||||
def transform(self, node, results) -> None: ...
|
||||
13
stdlib/lib2to3/fixes/fix_ws_comma.pyi
Normal file
13
stdlib/lib2to3/fixes/fix_ws_comma.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Leaf
|
||||
|
||||
class FixWsComma(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
PATTERN: ClassVar[str]
|
||||
COMMA: Leaf
|
||||
COLON: Leaf
|
||||
SEPS: tuple[Leaf, Leaf]
|
||||
def transform(self, node, results): ...
|
||||
21
stdlib/lib2to3/fixes/fix_xrange.pyi
Normal file
21
stdlib/lib2to3/fixes/fix_xrange.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
from _typeshed import Incomplete, StrPath
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Node
|
||||
|
||||
class FixXrange(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
transformed_xranges: set[Incomplete] | None
|
||||
def start_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def finish_tree(self, tree: Node, filename: StrPath) -> None: ...
|
||||
def transform(self, node, results): ...
|
||||
def transform_xrange(self, node, results) -> None: ...
|
||||
def transform_range(self, node, results): ...
|
||||
P1: ClassVar[str]
|
||||
p1: ClassVar[Incomplete]
|
||||
P2: ClassVar[str]
|
||||
p2: ClassVar[Incomplete]
|
||||
def in_special_context(self, node): ...
|
||||
9
stdlib/lib2to3/fixes/fix_xreadlines.pyi
Normal file
9
stdlib/lib2to3/fixes/fix_xreadlines.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixXreadlines(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
def transform(self, node, results) -> None: ...
|
||||
10
stdlib/lib2to3/fixes/fix_zip.pyi
Normal file
10
stdlib/lib2to3/fixes/fix_zip.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
class FixZip(fixer_base.ConditionalFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
PATTERN: ClassVar[str]
|
||||
skip_on: ClassVar[Literal["future_builtins.zip"]]
|
||||
def transform(self, node, results): ...
|
||||
Reference in New Issue
Block a user