mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Callable, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Optional, Union
|
||||
|
||||
_Macro = Union[Tuple[str], Tuple[str, Optional[str]]]
|
||||
_Macro = Union[tuple[str], tuple[str, Optional[str]]]
|
||||
|
||||
def gen_lib_options(
|
||||
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
|
||||
@@ -141,7 +141,7 @@ class CCompiler:
|
||||
def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ...
|
||||
def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ...
|
||||
def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
|
||||
def execute(self, func: Callable[..., None], args: Tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
|
||||
def execute(self, func: Callable[..., None], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
|
||||
def spawn(self, cmd: list[str]) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = ...) -> None: ...
|
||||
def move_file(self, src: str, dst: str) -> str: ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Tuple
|
||||
from typing import Any
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
HAS_USER_SITE: bool
|
||||
SCHEME_KEYS: Tuple[str, ...]
|
||||
SCHEME_KEYS: tuple[str, ...]
|
||||
INSTALL_SCHEMES: dict[str, dict[Any, Any]]
|
||||
|
||||
class install(Command):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Iterable, List, Mapping, Optional, Tuple, overload
|
||||
from typing import Any, Iterable, Mapping, Optional, overload
|
||||
|
||||
_Option = Tuple[str, Optional[str], str]
|
||||
_GR = Tuple[List[str], OptionDummy]
|
||||
_Option = tuple[str, Optional[str], str]
|
||||
_GR = tuple[list[str], OptionDummy]
|
||||
|
||||
def fancy_getopt(
|
||||
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Callable, Container, Iterable, Mapping
|
||||
from typing import Any, Tuple
|
||||
from typing import Any
|
||||
|
||||
def get_platform() -> str: ...
|
||||
def convert_path(pathname: str) -> str: ...
|
||||
@@ -9,7 +9,7 @@ def check_environ() -> None: ...
|
||||
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
|
||||
def split_quoted(s: str) -> list[str]: ...
|
||||
def execute(
|
||||
func: Callable[..., None], args: Tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
|
||||
func: Callable[..., None], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
|
||||
) -> None: ...
|
||||
def strtobool(val: str) -> bool: ...
|
||||
def byte_compile(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from abc import abstractmethod
|
||||
from typing import Pattern, Tuple, TypeVar
|
||||
from typing import Pattern, TypeVar
|
||||
|
||||
_T = TypeVar("_T", bound=Version)
|
||||
|
||||
@@ -31,7 +31,7 @@ class StrictVersion(Version):
|
||||
class LooseVersion(Version):
|
||||
component_re: Pattern[str]
|
||||
vstring: str
|
||||
version: Tuple[str | int, ...]
|
||||
version: tuple[str | int, ...]
|
||||
def __init__(self, vstring: str | None = ...) -> None: ...
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user