mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use Final for lib2to3 (#12451)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from typing import ClassVar, Literal
|
||||
from typing import ClassVar, Final, Literal
|
||||
|
||||
from ..fixer_base import BaseFix
|
||||
|
||||
NAMES: dict[str, str]
|
||||
NAMES: Final[dict[str, str]]
|
||||
|
||||
class FixAsserts(BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import ClassVar, Literal
|
||||
from typing import ClassVar, Final, Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
CMP: str
|
||||
TYPE: str
|
||||
CMP: Final[str]
|
||||
TYPE: Final[str]
|
||||
|
||||
class FixIdioms(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[False]]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Generator
|
||||
from typing import ClassVar, Literal
|
||||
from typing import ClassVar, Final, Literal
|
||||
|
||||
from .. import fixer_base
|
||||
from ..pytree import Node
|
||||
|
||||
MAPPING: dict[str, str]
|
||||
MAPPING: Final[dict[str, str]]
|
||||
|
||||
def alternates(members): ...
|
||||
def build_pattern(mapping=...) -> Generator[str, None, None]: ...
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from typing import Final
|
||||
|
||||
from . import fix_imports
|
||||
|
||||
MAPPING: dict[str, str]
|
||||
MAPPING: Final[dict[str, str]]
|
||||
|
||||
class FixImports2(fix_imports.FixImports):
|
||||
mapping = MAPPING
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import ClassVar, Literal
|
||||
from typing import ClassVar, Final, Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
MAP: dict[str, str]
|
||||
MAP: Final[dict[str, str]]
|
||||
|
||||
class FixMethodattrs(fixer_base.BaseFix):
|
||||
BM_compatible: ClassVar[Literal[True]]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from collections.abc import Generator
|
||||
from typing import ClassVar, Literal
|
||||
from typing import ClassVar, Final, Literal
|
||||
|
||||
from .. import fixer_base
|
||||
|
||||
MAPPING: dict[str, dict[str, str]]
|
||||
LOOKUP: dict[tuple[str, str], str]
|
||||
MAPPING: Final[dict[str, dict[str, str]]]
|
||||
LOOKUP: Final[dict[tuple[str, str], str]]
|
||||
|
||||
def alternates(members): ...
|
||||
def build_pattern() -> Generator[str, None, None]: ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from collections.abc import Generator
|
||||
from typing import Literal
|
||||
from typing import Final, Literal
|
||||
|
||||
from .fix_imports import FixImports
|
||||
|
||||
MAPPING: dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]
|
||||
MAPPING: Final[dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]]
|
||||
|
||||
def build_pattern() -> Generator[str, None, None]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user