Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -1,5 +1,4 @@
import sys
from typing import List
class _Feature:
def __init__(self, optionalRelease: sys._version_info, mandatoryRelease: sys._version_info, compiler_flag: int) -> None: ...
@@ -20,7 +19,7 @@ generator_stop: _Feature
if sys.version_info >= (3, 7):
annotations: _Feature
all_feature_names: List[str] # undocumented
all_feature_names: list[str] # undocumented
if sys.version_info >= (3, 7):
__all__ = [

View File

@@ -29,16 +29,16 @@ if sys.version_info >= (3, 8):
class TypeIgnore(type_ignore):
tag: str
class FunctionType(mod):
argtypes: typing.List[expr]
argtypes: list[expr]
returns: expr
class Module(mod):
body: typing.List[stmt]
body: list[stmt]
if sys.version_info >= (3, 8):
type_ignores: typing.List[TypeIgnore]
type_ignores: list[TypeIgnore]
class Interactive(mod):
body: typing.List[stmt]
body: list[stmt]
class Expression(mod):
body: expr
@@ -48,32 +48,32 @@ class stmt(AST): ...
class FunctionDef(stmt):
name: _identifier
args: arguments
body: typing.List[stmt]
decorator_list: typing.List[expr]
body: list[stmt]
decorator_list: list[expr]
returns: expr | None
class AsyncFunctionDef(stmt):
name: _identifier
args: arguments
body: typing.List[stmt]
decorator_list: typing.List[expr]
body: list[stmt]
decorator_list: list[expr]
returns: expr | None
class ClassDef(stmt):
name: _identifier
bases: typing.List[expr]
keywords: typing.List[keyword]
body: typing.List[stmt]
decorator_list: typing.List[expr]
bases: list[expr]
keywords: list[keyword]
body: list[stmt]
decorator_list: list[expr]
class Return(stmt):
value: expr | None
class Delete(stmt):
targets: typing.List[expr]
targets: list[expr]
class Assign(stmt):
targets: typing.List[expr]
targets: list[expr]
value: expr
class AugAssign(stmt):
@@ -90,60 +90,60 @@ class AnnAssign(stmt):
class For(stmt):
target: expr
iter: expr
body: typing.List[stmt]
orelse: typing.List[stmt]
body: list[stmt]
orelse: list[stmt]
class AsyncFor(stmt):
target: expr
iter: expr
body: typing.List[stmt]
orelse: typing.List[stmt]
body: list[stmt]
orelse: list[stmt]
class While(stmt):
test: expr
body: typing.List[stmt]
orelse: typing.List[stmt]
body: list[stmt]
orelse: list[stmt]
class If(stmt):
test: expr
body: typing.List[stmt]
orelse: typing.List[stmt]
body: list[stmt]
orelse: list[stmt]
class With(stmt):
items: typing.List[withitem]
body: typing.List[stmt]
items: list[withitem]
body: list[stmt]
class AsyncWith(stmt):
items: typing.List[withitem]
body: typing.List[stmt]
items: list[withitem]
body: list[stmt]
class Raise(stmt):
exc: expr | None
cause: expr | None
class Try(stmt):
body: typing.List[stmt]
handlers: typing.List[ExceptHandler]
orelse: typing.List[stmt]
finalbody: typing.List[stmt]
body: list[stmt]
handlers: list[ExceptHandler]
orelse: list[stmt]
finalbody: list[stmt]
class Assert(stmt):
test: expr
msg: expr | None
class Import(stmt):
names: typing.List[alias]
names: list[alias]
class ImportFrom(stmt):
module: _identifier | None
names: typing.List[alias]
names: list[alias]
level: int
class Global(stmt):
names: typing.List[_identifier]
names: list[_identifier]
class Nonlocal(stmt):
names: typing.List[_identifier]
names: list[_identifier]
class Expr(stmt):
value: expr
@@ -155,7 +155,7 @@ class expr(AST): ...
class BoolOp(expr):
op: boolop
values: typing.List[expr]
values: list[expr]
class BinOp(expr):
left: expr
@@ -176,28 +176,28 @@ class IfExp(expr):
orelse: expr
class Dict(expr):
keys: typing.List[expr | None]
values: typing.List[expr]
keys: list[expr | None]
values: list[expr]
class Set(expr):
elts: typing.List[expr]
elts: list[expr]
class ListComp(expr):
elt: expr
generators: typing.List[comprehension]
generators: list[comprehension]
class SetComp(expr):
elt: expr
generators: typing.List[comprehension]
generators: list[comprehension]
class DictComp(expr):
key: expr
value: expr
generators: typing.List[comprehension]
generators: list[comprehension]
class GeneratorExp(expr):
elt: expr
generators: typing.List[comprehension]
generators: list[comprehension]
class Await(expr):
value: expr
@@ -210,13 +210,13 @@ class YieldFrom(expr):
class Compare(expr):
left: expr
ops: typing.List[cmpop]
comparators: typing.List[expr]
ops: list[cmpop]
comparators: list[expr]
class Call(expr):
func: expr
args: typing.List[expr]
keywords: typing.List[keyword]
args: list[expr]
keywords: list[keyword]
class FormattedValue(expr):
value: expr
@@ -224,7 +224,7 @@ class FormattedValue(expr):
format_spec: expr | None
class JoinedStr(expr):
values: typing.List[expr]
values: list[expr]
if sys.version_info < (3, 8):
class Num(expr): # Deprecated in 3.8; use Constant
@@ -267,7 +267,7 @@ class Slice(_SliceT):
if sys.version_info < (3, 9):
class ExtSlice(slice):
dims: typing.List[slice]
dims: list[slice]
class Index(slice):
value: expr
@@ -285,11 +285,11 @@ class Name(expr):
ctx: expr_context
class List(expr):
elts: typing.List[expr]
elts: list[expr]
ctx: expr_context
class Tuple(expr):
elts: typing.List[expr]
elts: list[expr]
ctx: expr_context
class expr_context(AST): ...
@@ -299,7 +299,7 @@ if sys.version_info < (3, 9):
class AugStore(expr_context): ...
class Param(expr_context): ...
class Suite(mod):
body: typing.List[stmt]
body: list[stmt]
class Del(expr_context): ...
class Load(expr_context): ...
@@ -341,7 +341,7 @@ class NotIn(cmpop): ...
class comprehension(AST):
target: expr
iter: expr
ifs: typing.List[expr]
ifs: list[expr]
is_async: int
class excepthandler(AST): ...
@@ -349,17 +349,17 @@ class excepthandler(AST): ...
class ExceptHandler(excepthandler):
type: expr | None
name: _identifier | None
body: typing.List[stmt]
body: list[stmt]
class arguments(AST):
if sys.version_info >= (3, 8):
posonlyargs: typing.List[arg]
args: typing.List[arg]
posonlyargs: list[arg]
args: list[arg]
vararg: arg | None
kwonlyargs: typing.List[arg]
kw_defaults: typing.List[expr | None]
kwonlyargs: list[arg]
kw_defaults: list[expr | None]
kwarg: arg | None
defaults: typing.List[expr]
defaults: list[expr]
class arg(AST):
arg: _identifier
@@ -380,33 +380,33 @@ class withitem(AST):
if sys.version_info >= (3, 10):
class Match(stmt):
subject: expr
cases: typing.List[match_case]
cases: list[match_case]
class pattern(AST): ...
# Without the alias, Pyright complains variables named pattern are recursively defined
_pattern = pattern
class match_case(AST):
pattern: _pattern
guard: expr | None
body: typing.List[stmt]
body: list[stmt]
class MatchValue(pattern):
value: expr
class MatchSingleton(pattern):
value: Literal[True, False, None]
class MatchSequence(pattern):
patterns: typing.List[pattern]
patterns: list[pattern]
class MatchStar(pattern):
name: _identifier | None
class MatchMapping(pattern):
keys: typing.List[expr]
patterns: typing.List[pattern]
keys: list[expr]
patterns: list[pattern]
rest: _identifier | None
class MatchClass(pattern):
cls: expr
patterns: typing.List[pattern]
kwd_attrs: typing.List[_identifier]
kwd_patterns: typing.List[pattern]
patterns: list[pattern]
kwd_attrs: list[_identifier]
kwd_patterns: list[pattern]
class MatchAs(pattern):
pattern: _pattern | None
name: _identifier | None
class MatchOr(pattern):
patterns: typing.List[pattern]
patterns: list[pattern]

View File

@@ -1,10 +1,10 @@
from typing import Dict, Tuple
from typing import Tuple
IMPORT_MAPPING: Dict[str, str]
NAME_MAPPING: Dict[Tuple[str, str], Tuple[str, str]]
IMPORT_MAPPING: dict[str, str]
NAME_MAPPING: dict[Tuple[str, str], Tuple[str, str]]
PYTHON2_EXCEPTIONS: Tuple[str, ...]
MULTIPROCESSING_EXCEPTIONS: Tuple[str, ...]
REVERSE_IMPORT_MAPPING: Dict[str, str]
REVERSE_NAME_MAPPING: Dict[Tuple[str, str], Tuple[str, str]]
REVERSE_IMPORT_MAPPING: dict[str, str]
REVERSE_NAME_MAPPING: dict[Tuple[str, str], Tuple[str, str]]
PYTHON3_OSERROR_EXCEPTIONS: Tuple[str, ...]
PYTHON3_IMPORTERROR_EXCEPTIONS: Tuple[str, ...]

View File

@@ -23,7 +23,7 @@ _DialectLike = Union[str, Dialect, Type[Dialect]]
class _reader(Iterator[List[str]]):
dialect: Dialect
line_num: int
def __next__(self) -> List[str]: ...
def __next__(self) -> list[str]: ...
class _writer:
dialect: Dialect
@@ -38,5 +38,5 @@ def reader(csvfile: Iterable[str], dialect: _DialectLike = ..., **fmtparams: Any
def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ...
def unregister_dialect(name: str) -> None: ...
def get_dialect(name: str) -> Dialect: ...
def list_dialects() -> List[str]: ...
def list_dialects() -> list[str]: ...
def field_size_limit(new_limit: int = ...) -> int: ...

View File

@@ -1,9 +1,9 @@
from typing import Any, Callable, Dict, NoReturn, Tuple
from typing import Any, Callable, NoReturn, Tuple
TIMEOUT_MAX: int
error = RuntimeError
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ...
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ...
def exit() -> NoReturn: ...
def get_ident() -> int: ...
def allocate_lock() -> LockType: ...

View File

@@ -1,6 +1,6 @@
import sys
from types import FrameType, TracebackType
from typing import Any, Callable, Iterable, List, Mapping, Optional, Type, TypeVar
from typing import Any, Callable, Iterable, Mapping, Optional, Type, TypeVar
# TODO recursive type
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
@@ -8,13 +8,13 @@ _TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
_T = TypeVar("_T")
__all__: List[str]
__all__: list[str]
def active_count() -> int: ...
def current_thread() -> Thread: ...
def currentThread() -> Thread: ...
def get_ident() -> int: ...
def enumerate() -> List[Thread]: ...
def enumerate() -> list[Thread]: ...
def main_thread() -> Thread: ...
if sys.version_info >= (3, 8):

View File

@@ -1,9 +1,9 @@
from typing import Any, List, TypeVar
from typing import Any, TypeVar
_T = TypeVar("_T")
def heapify(__heap: List[Any]) -> None: ...
def heappop(__heap: List[_T]) -> _T: ...
def heappush(__heap: List[_T], __item: _T) -> None: ...
def heappushpop(__heap: List[_T], __item: _T) -> _T: ...
def heapreplace(__heap: List[_T], __item: _T) -> _T: ...
def heapify(__heap: list[Any]) -> None: ...
def heappop(__heap: list[_T]) -> _T: ...
def heappush(__heap: list[_T], __item: _T) -> None: ...
def heappushpop(__heap: list[_T], __item: _T) -> _T: ...
def heapreplace(__heap: list[_T], __item: _T) -> _T: ...

View File

@@ -1,13 +1,13 @@
import types
from importlib.machinery import ModuleSpec
from typing import Any, List
from typing import Any
def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ...
def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> None: ...
def acquire_lock() -> None: ...
def exec_builtin(__mod: types.ModuleType) -> int: ...
def exec_dynamic(__mod: types.ModuleType) -> int: ...
def extension_suffixes() -> List[str]: ...
def extension_suffixes() -> list[str]: ...
def get_frozen_object(__name: str) -> types.CodeType: ...
def init_frozen(__name: str) -> types.ModuleType: ...
def is_builtin(__name: str) -> int: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, Tuple
from typing import Any, Callable, Tuple
class make_encoder:
sort_keys: Any
@@ -11,7 +11,7 @@ class make_encoder:
item_separator: Any
def __init__(
self,
markers: Dict[int, Any] | None,
markers: dict[int, Any] | None,
default: Callable[[Any], Any],
encoder: Callable[[str], str],
indent: int | None,

View File

@@ -1,5 +1,4 @@
import sys
from typing import List
if sys.platform == "win32":
@@ -44,6 +43,6 @@ if sys.platform == "win32":
__new__: None # type: ignore
__init__: None # type: ignore
def UuidCreate() -> str: ...
def FCICreate(cabname: str, files: List[str]) -> None: ...
def FCICreate(cabname: str, files: list[str]) -> None: ...
def OpenDatabase(name: str, flags: int) -> _Database: ...
def CreateRecord(count: int) -> _Record: ...

View File

@@ -1,10 +1,10 @@
from typing import Dict, Iterable, List, Sequence, Tuple, TypeVar
from typing import Iterable, Sequence, Tuple, TypeVar
_T = TypeVar("_T")
_K = TypeVar("_K")
_V = TypeVar("_V")
__all__: List[str]
__all__: list[str]
_UNIVERSAL_CONFIG_VARS: Tuple[str, ...] # undocumented
_COMPILER_CONFIG_VARS: Tuple[str, ...] # undocumented
@@ -17,17 +17,17 @@ def _find_build_tool(toolname: str) -> str: ... # undocumented
_SYSTEM_VERSION: str | None # undocumented
def _get_system_version() -> str: ... # undocumented
def _remove_original_values(_config_vars: Dict[str, str]) -> None: ... # undocumented
def _save_modified_value(_config_vars: Dict[str, str], cv: str, newvalue: str) -> None: ... # undocumented
def _remove_original_values(_config_vars: dict[str, str]) -> None: ... # undocumented
def _save_modified_value(_config_vars: dict[str, str], cv: str, newvalue: str) -> None: ... # undocumented
def _supports_universal_builds() -> bool: ... # undocumented
def _find_appropriate_compiler(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _remove_universal_flags(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _remove_unsupported_archs(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _override_all_archs(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _check_for_unavailable_sdk(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def compiler_fixup(compiler_so: Iterable[str], cc_args: Sequence[str]) -> List[str]: ...
def customize_config_vars(_config_vars: Dict[str, str]) -> Dict[str, str]: ...
def customize_compiler(_config_vars: Dict[str, str]) -> Dict[str, str]: ...
def _find_appropriate_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _remove_universal_flags(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _remove_unsupported_archs(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _override_all_archs(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _check_for_unavailable_sdk(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def compiler_fixup(compiler_so: Iterable[str], cc_args: Sequence[str]) -> list[str]: ...
def customize_config_vars(_config_vars: dict[str, str]) -> dict[str, str]: ...
def customize_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ...
def get_platform_osx(
_config_vars: Dict[str, str], osname: _T, release: _K, machine: _V
_config_vars: dict[str, str], osname: _T, release: _K, machine: _V
) -> Tuple[str | _T, str | _K, str | _V]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Dict, Tuple, Type, TypeVar
from typing import Any, Tuple, Type, TypeVar
_T = TypeVar("_T")
@@ -6,5 +6,5 @@ _T = TypeVar("_T")
def get_cache_token() -> object: ...
class ABCMeta(type):
def __new__(__mcls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: Dict[str, Any]) -> ABCMeta: ...
def __new__(__mcls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: dict[str, Any]) -> ABCMeta: ...
def register(cls, subclass: Type[_T]) -> Type[_T]: ...

View File

@@ -1,7 +1,7 @@
import sys
from threading import Thread
from types import TracebackType
from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type
from typing import Any, Callable, NoReturn, Optional, Tuple, Type
error = RuntimeError
@@ -18,7 +18,7 @@ class LockType:
self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> int: ...
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ...
def interrupt_main() -> None: ...
def exit() -> NoReturn: ...
def allocate_lock() -> LockType: ...

View File

@@ -5,7 +5,7 @@ localdict = Dict[Any, Any]
class _localimpl:
key: str
dicts: Dict[int, Tuple[ReferenceType[Any], localdict]]
dicts: dict[int, Tuple[ReferenceType[Any], localdict]]
def __init__(self) -> None: ...
def get_dict(self) -> localdict: ...
def create_dict(self) -> localdict: ...

View File

@@ -3,12 +3,12 @@
# See the README.md file in this directory for more information.
from sys import _OptExcInfo
from typing import Any, Callable, Dict, Iterable, List, Protocol, Tuple
from typing import Any, Callable, Dict, Iterable, Protocol, Tuple
# stable
class StartResponse(Protocol):
def __call__(
self, status: str, headers: List[Tuple[str, str]], exc_info: _OptExcInfo | None = ...
self, status: str, headers: list[Tuple[str, str]], exc_info: _OptExcInfo | None = ...
) -> Callable[[bytes], Any]: ...
WSGIEnvironment = Dict[str, Any] # stable
@@ -18,14 +18,14 @@ WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] #
class InputStream(Protocol):
def read(self, size: int = ...) -> bytes: ...
def readline(self, size: int = ...) -> bytes: ...
def readlines(self, hint: int = ...) -> List[bytes]: ...
def readlines(self, hint: int = ...) -> list[bytes]: ...
def __iter__(self) -> Iterable[bytes]: ...
# WSGI error streams per PEP 3333, stable
class ErrorStream(Protocol):
def flush(self) -> None: ...
def write(self, s: str) -> None: ...
def writelines(self, seq: List[str]) -> None: ...
def writelines(self, seq: list[str]) -> None: ...
class _Readable(Protocol):
def read(self, size: int = ...) -> bytes: ...

View File

@@ -1,8 +1,8 @@
from typing import Any, Dict, List, Tuple, Type, overload
from typing import Any, Tuple, Type, overload
_defaultaction: str
_onceregistry: Dict[Any, Any]
filters: List[Tuple[Any, ...]]
_onceregistry: dict[Any, Any]
filters: list[Tuple[Any, ...]]
@overload
def warn(message: str, category: Type[Warning] | None = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ...
@@ -15,8 +15,8 @@ def warn_explicit(
filename: str,
lineno: int,
module: str | None = ...,
registry: Dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
module_globals: Dict[str, Any] | None = ...,
registry: dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
module_globals: dict[str, Any] | None = ...,
source: Any | None = ...,
) -> None: ...
@overload
@@ -26,7 +26,7 @@ def warn_explicit(
filename: str,
lineno: int,
module: str | None = ...,
registry: Dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
module_globals: Dict[str, Any] | None = ...,
registry: dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
module_globals: dict[str, Any] | None = ...,
source: Any | None = ...,
) -> None: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Generic, List, TypeVar, overload
from typing import Any, Callable, Generic, TypeVar, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -24,7 +24,7 @@ class ReferenceType(Generic[_T]):
ref = ReferenceType
def getweakrefcount(__object: Any) -> int: ...
def getweakrefs(object: Any) -> List[Any]: ...
def getweakrefs(object: Any) -> list[Any]: ...
@overload
def proxy(object: _C, callback: Callable[[_C], Any] | None = ...) -> CallableProxyType[_C]: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, NoReturn, Sequence, Tuple, overload
from typing import Any, NoReturn, Sequence, Tuple, overload
from typing_extensions import Literal
CREATE_NEW_CONSOLE: int
@@ -81,7 +81,7 @@ def CreateProcess(
__thread_attrs: Any,
__inherit_handles: bool,
__creation_flags: int,
__env_mapping: Dict[str, str],
__env_mapping: dict[str, str],
__current_directory: str | None,
__startup_info: Any,
) -> Tuple[int, int, int, int]: ...

View File

@@ -1,5 +1,5 @@
from _typeshed import SupportsWrite
from typing import Any, Callable, Dict, Tuple, Type, TypeVar
from typing import Any, Callable, Tuple, Type, TypeVar
_T = TypeVar("_T")
_FuncT = TypeVar("_FuncT", bound=Callable[..., Any])
@@ -7,7 +7,7 @@ _FuncT = TypeVar("_FuncT", bound=Callable[..., Any])
# These definitions have special processing in mypy
class ABCMeta(type):
__abstractmethods__: frozenset[str]
def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> None: ...
def __init__(self, name: str, bases: Tuple[type, ...], namespace: dict[str, Any]) -> None: ...
def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ...
def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ...
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ...

View File

@@ -1,7 +1,7 @@
import sys
from _typeshed import Self
from types import TracebackType
from typing import IO, Any, List, NamedTuple, Tuple, Type, Union, overload
from typing import IO, Any, NamedTuple, Tuple, Type, Union, overload
from typing_extensions import Literal
class Error(Exception): ...
@@ -35,7 +35,7 @@ class Aifc_read:
def getcomptype(self) -> bytes: ...
def getcompname(self) -> bytes: ...
def getparams(self) -> _aifc_params: ...
def getmarkers(self) -> List[_Marker] | None: ...
def getmarkers(self) -> list[_Marker] | None: ...
def getmark(self, id: int) -> _Marker: ...
def setpos(self, pos: int) -> None: ...
def readframes(self, nframes: int) -> bytes: ...
@@ -65,7 +65,7 @@ class Aifc_write:
def getparams(self) -> _aifc_params: ...
def setmark(self, id: int, pos: int, name: bytes) -> None: ...
def getmark(self, id: int) -> _Marker: ...
def getmarkers(self) -> List[_Marker] | None: ...
def getmarkers(self) -> list[_Marker] | None: ...
def tell(self) -> int: ...
def writeframesraw(self, data: Any) -> None: ... # Actual type for data is Buffer Protocol
def writeframes(self, data: Any) -> None: ...

View File

@@ -1,21 +1,5 @@
import sys
from typing import (
IO,
Any,
Callable,
Dict,
Generator,
Iterable,
List,
NoReturn,
Pattern,
Protocol,
Sequence,
Tuple,
Type,
TypeVar,
overload,
)
from typing import IO, Any, Callable, Generator, Iterable, NoReturn, Pattern, Protocol, Sequence, Tuple, Type, TypeVar, overload
_T = TypeVar("_T")
_ActionT = TypeVar("_ActionT", bound=Action)
@@ -36,8 +20,8 @@ class ArgumentError(Exception):
# undocumented
class _AttributeHolder:
def _get_kwargs(self) -> List[Tuple[str, Any]]: ...
def _get_args(self) -> List[Any]: ...
def _get_kwargs(self) -> list[Tuple[str, Any]]: ...
def _get_args(self) -> list[Any]: ...
# undocumented
class _ActionsContainer:
@@ -46,14 +30,14 @@ class _ActionsContainer:
argument_default: Any
conflict_handler: str
_registries: Dict[str, Dict[Any, Any]]
_actions: List[Action]
_option_string_actions: Dict[str, Action]
_action_groups: List[_ArgumentGroup]
_mutually_exclusive_groups: List[_MutuallyExclusiveGroup]
_defaults: Dict[str, Any]
_registries: dict[str, dict[Any, Any]]
_actions: list[Action]
_option_string_actions: dict[str, Action]
_action_groups: list[_ArgumentGroup]
_mutually_exclusive_groups: list[_MutuallyExclusiveGroup]
_defaults: dict[str, Any]
_negative_number_matcher: Pattern[str]
_has_negative_number_optionals: List[bool]
_has_negative_number_optionals: list[bool]
def __init__(self, description: str | None, prefix_chars: str, argument_default: Any, conflict_handler: str) -> None: ...
def register(self, registry_name: str, value: Any, object: Any) -> None: ...
def _registry_get(self, registry_name: str, value: Any, default: Any = ...) -> Any: ...
@@ -80,8 +64,8 @@ class _ActionsContainer:
def _add_action(self, action: _ActionT) -> _ActionT: ...
def _remove_action(self, action: Action) -> None: ...
def _add_container_actions(self, container: _ActionsContainer) -> None: ...
def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> Dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ...
def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
def _pop_action_class(self, kwargs: Any, default: Type[Action] | None = ...) -> Type[Action]: ...
def _get_handler(self) -> Callable[[Action, Iterable[Tuple[str, Action]]], Any]: ...
def _check_conflict(self, action: Action) -> None: ...
@@ -185,26 +169,26 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def format_help(self) -> str: ...
def parse_known_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, List[str]]: ...
def convert_arg_line_to_args(self, arg_line: str) -> List[str]: ...
) -> Tuple[Namespace, list[str]]: ...
def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ...
def exit(self, status: int = ..., message: str | None = ...) -> NoReturn: ...
def error(self, message: str) -> NoReturn: ...
if sys.version_info >= (3, 7):
def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ...
def parse_known_intermixed_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, List[str]]: ...
) -> Tuple[Namespace, list[str]]: ...
# undocumented
def _get_optional_actions(self) -> List[Action]: ...
def _get_positional_actions(self) -> List[Action]: ...
def _parse_known_args(self, arg_strings: List[str], namespace: Namespace) -> Tuple[Namespace, List[str]]: ...
def _read_args_from_files(self, arg_strings: List[str]) -> List[str]: ...
def _get_optional_actions(self) -> list[Action]: ...
def _get_positional_actions(self) -> list[Action]: ...
def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> Tuple[Namespace, list[str]]: ...
def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ...
def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> List[int]: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ...
def _parse_optional(self, arg_string: str) -> Tuple[Action | None, str, str | None] | None: ...
def _get_option_tuples(self, option_string: str) -> List[Tuple[Action, str, str | None]]: ...
def _get_option_tuples(self, option_string: str) -> list[Tuple[Action, str, str | None]]: ...
def _get_nargs_pattern(self, action: Action) -> str: ...
def _get_values(self, action: Action, arg_strings: List[str]) -> Any: ...
def _get_values(self, action: Action, arg_strings: list[str]) -> Any: ...
def _get_value(self, action: Action, arg_string: str) -> Any: ...
def _check_value(self, action: Action, value: Any) -> None: ...
def _get_formatter(self) -> HelpFormatter: ...
@@ -249,7 +233,7 @@ class HelpFormatter:
def _format_args(self, action: Action, default_metavar: str) -> str: ...
def _expand_help(self, action: Action) -> str: ...
def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ...
def _split_lines(self, text: str, width: int) -> List[str]: ...
def _split_lines(self, text: str, width: int) -> list[str]: ...
def _fill_text(self, text: str, width: int, indent: str) -> str: ...
def _get_help_string(self, action: Action) -> str | None: ...
def _get_default_metavar_for_optional(self, action: Action) -> str: ...
@@ -322,7 +306,7 @@ class FileType:
# undocumented
class _ArgumentGroup(_ActionsContainer):
title: str | None
_group_actions: List[Action]
_group_actions: list[Action]
def __init__(
self, container: _ActionsContainer, title: str | None = ..., description: str | None = ..., **kwargs: Any
) -> None: ...
@@ -399,9 +383,9 @@ class _SubParsersAction(Action):
_ChoicesPseudoAction: Type[Any] # nested class
_prog_prefix: str
_parser_class: Type[ArgumentParser]
_name_parser_map: Dict[str, ArgumentParser]
choices: Dict[str, ArgumentParser]
_choices_actions: List[Action]
_name_parser_map: dict[str, ArgumentParser]
choices: dict[str, ArgumentParser]
_choices_actions: list[Action]
if sys.version_info >= (3, 7):
def __init__(
self,
@@ -425,7 +409,7 @@ class _SubParsersAction(Action):
) -> None: ...
# TODO: Type keyword args properly.
def add_parser(self, name: str, **kwargs: Any) -> ArgumentParser: ...
def _get_subactions(self) -> List[Action]: ...
def _get_subactions(self) -> list[Action]: ...
# undocumented
class ArgumentTypeError(Exception): ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
@@ -29,7 +29,7 @@ class array(MutableSequence[_T], Generic[_T]):
def extend(self, __bb: Iterable[_T]) -> None: ...
def frombytes(self, __buffer: bytes) -> None: ...
def fromfile(self, __f: BinaryIO, __n: int) -> None: ...
def fromlist(self, __list: List[_T]) -> None: ...
def fromlist(self, __list: list[_T]) -> None: ...
def fromunicode(self, __ustr: str) -> None: ...
if sys.version_info >= (3, 10):
def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ...
@@ -41,7 +41,7 @@ class array(MutableSequence[_T], Generic[_T]):
def reverse(self) -> None: ...
def tobytes(self) -> bytes: ...
def tofile(self, __f: BinaryIO) -> None: ...
def tolist(self) -> List[_T]: ...
def tolist(self) -> list[_T]: ...
def tounicode(self) -> str: ...
if sys.version_info < (3, 9):
def fromstring(self, __buffer: bytes) -> None: ...

View File

@@ -9,7 +9,7 @@ from asyncio.tasks import Task
from asyncio.transports import BaseTransport
from collections.abc import Iterable
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Sequence, Tuple, TypeVar, Union, overload
from typing import IO, Any, Awaitable, Callable, Dict, Generator, Sequence, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
if sys.version_info >= (3, 7):
@@ -89,7 +89,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
# Network I/O methods returning Futures.
async def getaddrinfo(
self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...
) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[str, int] | Tuple[str, int, int, int]]]: ...
) -> list[Tuple[AddressFamily, SocketKind, int, str, Tuple[str, int] | Tuple[str, int, int, int]]]: ...
async def getnameinfo(self, sockaddr: Tuple[str, int] | Tuple[str, int, int, int], flags: int = ...) -> Tuple[str, str]: ...
if sys.version_info >= (3, 8):
@overload

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, List, Sequence, Tuple
from typing import Any, Callable, Sequence, Tuple
from typing_extensions import Literal
if sys.version_info >= (3, 7):
@@ -19,4 +19,4 @@ if sys.version_info >= (3, 7):
else:
def _format_callbacks(cb: Sequence[Callable[[futures.Future[Any]], None]]) -> str: ... # undocumented
def _future_repr_info(future: futures.Future[Any]) -> List[str]: ... # undocumented
def _future_repr_info(future: futures.Future[Any]) -> list[str]: ... # undocumented

View File

@@ -1,5 +1,5 @@
import subprocess
from typing import IO, Any, Callable, Deque, Dict, List, Optional, Sequence, Tuple, Union
from typing import IO, Any, Callable, Deque, Optional, Sequence, Tuple, Union
from . import events, futures, protocols, transports
@@ -13,9 +13,9 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
_proc: subprocess.Popen[Any] | None # undocumented
_pid: int | None # undocumented
_returncode: int | None # undocumented
_exit_waiters: List[futures.Future[Any]] # undocumented
_exit_waiters: list[futures.Future[Any]] # undocumented
_pending_calls: Deque[Tuple[Callable[..., Any], Tuple[Any, ...]]] # undocumented
_pipes: Dict[int, _File] # undocumented
_pipes: dict[int, _File] # undocumented
_finished: bool # undocumented
def __init__(
self,

View File

@@ -1,9 +1,9 @@
from _typeshed import StrOrBytesPath
from types import FrameType
from typing import Any, List
from typing import Any
from . import tasks
def _task_repr_info(task: tasks.Task[Any]) -> List[str]: ... # undocumented
def _task_get_stack(task: tasks.Task[Any], limit: int | None) -> List[FrameType]: ... # undocumented
def _task_repr_info(task: tasks.Task[Any]) -> list[str]: ... # undocumented
def _task_get_stack(task: tasks.Task[Any], limit: int | None) -> list[FrameType]: ... # undocumented
def _task_print_stack(task: tasks.Task[Any], limit: int | None, file: StrOrBytesPath) -> None: ... # undocumented

View File

@@ -1,8 +1,7 @@
import sys
from typing import List
if sys.version_info < (3, 7):
PY34: bool
PY35: bool
PY352: bool
def flatten_list_bytes(list_of_data: List[bytes]) -> bytes: ...
def flatten_list_bytes(list_of_data: list[bytes]) -> bytes: ...

View File

@@ -3,7 +3,7 @@ import sys
from _typeshed import FileDescriptorLike, Self
from abc import ABCMeta, abstractmethod
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Sequence, Tuple, TypeVar, Union, overload
from typing import IO, Any, Awaitable, Callable, Dict, Generator, Sequence, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
from .base_events import Server
@@ -120,7 +120,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
async def getaddrinfo(
self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...
) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[str, int] | Tuple[str, int, int, int]]]: ...
) -> list[Tuple[AddressFamily, SocketKind, int, str, Tuple[str, int] | Tuple[str, int, int, int]]]: ...
@abstractmethod
async def getnameinfo(self, sockaddr: Tuple[str, int] | Tuple[str, int, int, int], flags: int = ...) -> Tuple[str, str]: ...
if sys.version_info >= (3, 8):

View File

@@ -2,7 +2,7 @@ import functools
import sys
import traceback
from types import FrameType, FunctionType
from typing import Any, Dict, Iterable, Tuple, Union, overload
from typing import Any, Iterable, Tuple, Union, overload
class _HasWrapper:
__wrapper__: _HasWrapper | FunctionType
@@ -15,6 +15,6 @@ if sys.version_info >= (3, 7):
@overload
def _get_function_source(func: object) -> Tuple[str, int] | None: ...
def _format_callback_source(func: object, args: Iterable[Any]) -> str: ...
def _format_args_and_kwargs(args: Iterable[Any], kwargs: Dict[str, Any]) -> str: ...
def _format_callback(func: object, args: Iterable[Any], kwargs: Dict[str, Any], suffix: str = ...) -> str: ...
def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ...
def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = ...) -> str: ...
def extract_stack(f: FrameType | None = ..., limit: int | None = ...) -> traceback.StackSummary: ...

View File

@@ -1,6 +1,6 @@
import sys
from concurrent.futures._base import Error, Future as _ConcurrentFuture
from typing import Any, Awaitable, Callable, Generator, Iterable, List, Tuple, TypeVar
from typing import Any, Awaitable, Callable, Generator, Iterable, Tuple, TypeVar
from .events import AbstractEventLoop
@@ -20,7 +20,7 @@ _S = TypeVar("_S")
if sys.version_info < (3, 7):
class _TracebackLogger:
exc: BaseException
tb: List[str]
tb: list[str]
def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
def activate(self) -> None: ...
def clear(self) -> None: ...
@@ -38,11 +38,11 @@ class Future(Awaitable[_T], Iterable[_T]):
def __del__(self) -> None: ...
if sys.version_info >= (3, 7):
def get_loop(self) -> AbstractEventLoop: ...
def _callbacks(self: _S) -> List[Tuple[Callable[[_S], Any], Context]]: ...
def _callbacks(self: _S) -> list[Tuple[Callable[[_S], Any], Context]]: ...
def add_done_callback(self: _S, __fn: Callable[[_S], Any], *, context: Context | None = ...) -> None: ...
else:
@property
def _callbacks(self: _S) -> List[Callable[[_S], Any]]: ...
def _callbacks(self: _S) -> list[Callable[[_S], Any]]: ...
def add_done_callback(self: _S, __fn: Callable[[_S], Any]) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: str | None = ...) -> bool: ...

View File

@@ -1,6 +1,6 @@
import ssl
import sys
from typing import Any, Callable, ClassVar, Deque, Dict, List, Tuple
from typing import Any, Callable, ClassVar, Deque, Tuple
from typing_extensions import Literal
from . import constants, events, futures, protocols, transports
@@ -35,11 +35,11 @@ class _SSLPipe:
def need_ssldata(self) -> bool: ...
@property
def wrapped(self) -> bool: ...
def do_handshake(self, callback: Callable[[BaseException | None], None] | None = ...) -> List[bytes]: ...
def shutdown(self, callback: Callable[[], None] | None = ...) -> List[bytes]: ...
def do_handshake(self, callback: Callable[[BaseException | None], None] | None = ...) -> list[bytes]: ...
def shutdown(self, callback: Callable[[], None] | None = ...) -> list[bytes]: ...
def feed_eof(self) -> None: ...
def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> Tuple[List[bytes], List[bytes]]: ...
def feed_appdata(self, data: bytes, offset: int = ...) -> Tuple[List[bytes], int]: ...
def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> Tuple[list[bytes], list[bytes]]: ...
def feed_appdata(self, data: bytes, offset: int = ...) -> Tuple[list[bytes], int]: ...
class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
@@ -49,7 +49,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
_ssl_protocol: SSLProtocol
_closed: bool
def __init__(self, loop: events.AbstractEventLoop, ssl_protocol: SSLProtocol) -> None: ...
def get_extra_info(self, name: str, default: Any | None = ...) -> Dict[str, Any]: ...
def get_extra_info(self, name: str, default: Any | None = ...) -> dict[str, Any]: ...
def set_protocol(self, protocol: protocols.BaseProtocol) -> None: ...
def get_protocol(self) -> protocols.BaseProtocol: ...
def is_closing(self) -> bool: ...
@@ -72,7 +72,7 @@ class SSLProtocol(protocols.Protocol):
_server_side: bool
_server_hostname: str | None
_sslcontext: ssl.SSLContext
_extra: Dict[str, Any]
_extra: dict[str, Any]
_write_backlog: Deque[Tuple[bytes, int]]
_write_buffer_size: int
_waiter: futures.Future[Any]

View File

@@ -1,9 +1,9 @@
import sys
from typing import Any, Awaitable, Callable, Iterable, List, Tuple
from typing import Any, Awaitable, Callable, Iterable, Tuple
from . import events
if sys.version_info >= (3, 8):
async def staggered_race(
coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = ...
) -> Tuple[Any, int | None, List[Exception | None]]: ...
) -> Tuple[Any, int | None, list[Exception | None]]: ...

View File

@@ -2,7 +2,7 @@ import concurrent.futures
import sys
from collections.abc import Awaitable, Generator, Iterable, Iterator
from types import FrameType
from typing import Any, Generic, List, Optional, Set, TextIO, Tuple, TypeVar, Union, overload
from typing import Any, Generic, Optional, Set, TextIO, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
from .events import AbstractEventLoop
@@ -89,7 +89,7 @@ if sys.version_info >= (3, 10):
coro_or_future6: _FutureT[Any],
*coros_or_futures: _FutureT[Any],
return_exceptions: bool = ...,
) -> Future[List[Any]]: ...
) -> Future[list[Any]]: ...
@overload
def gather(coro_or_future1: _FutureT[_T1], *, return_exceptions: bool = ...) -> Future[Tuple[_T1 | BaseException]]: ...
@overload
@@ -180,7 +180,7 @@ else:
*coros_or_futures: _FutureT[Any],
loop: AbstractEventLoop | None = ...,
return_exceptions: bool = ...,
) -> Future[List[Any]]: ...
) -> Future[list[Any]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: bool = ...
@@ -268,7 +268,7 @@ class Task(Future[_T], Generic[_T]):
def get_coro(self) -> Generator[_TaskYieldType, None, _T] | Awaitable[_T]: ...
def get_name(self) -> str: ...
def set_name(self, __value: object) -> None: ...
def get_stack(self, *, limit: int | None = ...) -> List[FrameType]: ...
def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ...
def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: str | None = ...) -> bool: ...

View File

@@ -2,7 +2,7 @@ import sys
from asyncio.events import AbstractEventLoop
from asyncio.protocols import BaseProtocol
from socket import _Address
from typing import Any, List, Mapping, Tuple
from typing import Any, Mapping, Tuple
class BaseTransport:
def __init__(self, extra: Mapping[Any, Any] | None = ...) -> None: ...
@@ -22,7 +22,7 @@ class WriteTransport(BaseTransport):
def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ...
def get_write_buffer_size(self) -> int: ...
def write(self, data: Any) -> None: ...
def writelines(self, list_of_data: List[Any]) -> None: ...
def writelines(self, list_of_data: list[Any]) -> None: ...
def write_eof(self) -> None: ...
def can_write_eof(self) -> bool: ...
def abort(self) -> None: ...

View File

@@ -1,7 +1,7 @@
import socket
import sys
from types import TracebackType
from typing import Any, BinaryIO, Iterable, List, NoReturn, Tuple, Type, Union, overload
from typing import Any, BinaryIO, Iterable, NoReturn, Tuple, Type, Union, overload
if sys.version_info >= (3, 8):
# These are based in socket, maybe move them out into _typeshed.pyi or such
@@ -73,8 +73,8 @@ if sys.version_info >= (3, 8):
def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> Tuple[int, _RetAddress]: ...
def recvmsg_into(
self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., __flags: int = ...
) -> Tuple[int, List[_CMSG], int, Any]: ...
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ...
) -> Tuple[int, list[_CMSG], int, Any]: ...
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, list[_CMSG], int, Any]: ...
def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ...
def recv(self, bufsize: int, flags: int = ...) -> bytes: ...
def settimeout(self, value: float | None) -> None: ...

View File

@@ -1,7 +1,7 @@
import socket
import sys
from _typeshed import WriteableBuffer
from typing import IO, Any, Callable, ClassVar, List, NoReturn, Tuple, Type
from typing import IO, Any, Callable, ClassVar, NoReturn, Tuple, Type
from . import events, futures, proactor_events, selector_events, streams, windows_utils
@@ -36,14 +36,14 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
) -> Tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ...
async def start_serving_pipe(
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
) -> List[PipeServer]: ...
) -> list[PipeServer]: ...
class IocpProactor:
def __init__(self, concurrency: int = ...) -> None: ...
def __repr__(self) -> str: ...
def __del__(self) -> None: ...
def set_loop(self, loop: events.AbstractEventLoop) -> None: ...
def select(self, timeout: int | None = ...) -> List[futures.Future[Any]]: ...
def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ...
def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ...
if sys.version_info >= (3, 7):
def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ...

View File

@@ -1,5 +1,5 @@
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, Callable, Dict, Iterable, List, Mapping, Set, SupportsInt, Tuple, Type, TypeVar
from typing import IO, Any, Callable, Iterable, Mapping, Set, SupportsInt, Tuple, Type, TypeVar
_T = TypeVar("_T")
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
@@ -12,8 +12,8 @@ class BdbQuit(Exception): ...
class Bdb:
skip: Set[str] | None
breaks: Dict[str, List[int]]
fncache: Dict[str, str]
breaks: dict[str, list[int]]
fncache: dict[str, str]
frame_returning: FrameType | None
botframe: FrameType | None
quitting: bool
@@ -53,21 +53,21 @@ class Bdb:
def clear_all_breaks(self) -> None: ...
def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ...
def get_break(self, filename: str, lineno: int) -> bool: ...
def get_breaks(self, filename: str, lineno: int) -> List[Breakpoint]: ...
def get_file_breaks(self, filename: str) -> List[Breakpoint]: ...
def get_all_breaks(self) -> List[Breakpoint]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> Tuple[List[Tuple[FrameType, int]], int]: ...
def get_breaks(self, filename: str, lineno: int) -> list[Breakpoint]: ...
def get_file_breaks(self, filename: str) -> list[Breakpoint]: ...
def get_all_breaks(self) -> list[Breakpoint]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> Tuple[list[Tuple[FrameType, int]], int]: ...
def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ...
def run(self, cmd: str | CodeType, globals: Dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: Dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runctx(self, cmd: str | CodeType, globals: Dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ...
class Breakpoint:
next: int = ...
bplist: Dict[Tuple[str, int], List[Breakpoint]] = ...
bpbynumber: List[Breakpoint | None] = ...
bplist: dict[Tuple[str, int], list[Breakpoint]] = ...
bpbynumber: list[Breakpoint | None] = ...
funcname: str | None
func_first_executable_line: int | None

View File

@@ -29,14 +29,12 @@ from typing import (
BinaryIO,
ByteString,
Callable,
Dict,
FrozenSet,
Generic,
ItemsView,
Iterable,
Iterator,
KeysView,
List,
Mapping,
MutableMapping,
MutableSequence,
@@ -84,10 +82,10 @@ _TBE = TypeVar("_TBE", bound="BaseException")
class object:
__doc__: str | None
__dict__: Dict[str, Any]
__dict__: dict[str, Any]
__slots__: str | Iterable[str]
__module__: str
__annotations__: Dict[str, Any]
__annotations__: dict[str, Any]
@property
def __class__(self: _T) -> Type[_T]: ...
# Ignore errors about type mismatch between property getter and setter
@@ -131,7 +129,7 @@ class type(object):
__base__: type
__bases__: Tuple[type, ...]
__basicsize__: int
__dict__: Dict[str, Any]
__dict__: dict[str, Any]
__dictoffset__: int
__flags__: int
__itemsize__: int
@@ -144,16 +142,16 @@ class type(object):
@overload
def __init__(self, o: object) -> None: ...
@overload
def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any], **kwds: Any) -> None: ...
def __init__(self, name: str, bases: Tuple[type, ...], dict: dict[str, Any], **kwds: Any) -> None: ...
@overload
def __new__(cls, o: object) -> type: ...
@overload
def __new__(cls: Type[_TT], name: str, bases: Tuple[type, ...], namespace: Dict[str, Any], **kwds: Any) -> _TT: ...
def __new__(cls: Type[_TT], name: str, bases: Tuple[type, ...], namespace: dict[str, Any], **kwds: Any) -> _TT: ...
def __call__(self, *args: Any, **kwds: Any) -> Any: ...
def __subclasses__(self: _TT) -> List[_TT]: ...
def __subclasses__(self: _TT) -> list[_TT]: ...
# Note: the documentation doesnt specify what the return type is, the standard
# implementation seems to be returning a list.
def mro(self) -> List[type]: ...
def mro(self) -> list[type]: ...
def __instancecheck__(self, instance: Any) -> bool: ...
def __subclasscheck__(self, subclass: type) -> bool: ...
@classmethod
@@ -378,10 +376,10 @@ class str(Sequence[str]):
def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ...
def rpartition(self, __sep: str) -> Tuple[str, str, str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> List[str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
def rstrip(self, __chars: str | None = ...) -> str: ...
def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> List[str]: ...
def splitlines(self, keepends: bool = ...) -> List[str]: ...
def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
def splitlines(self, keepends: bool = ...) -> list[str]: ...
def startswith(
self, __prefix: str | Tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> bool: ...
@@ -393,10 +391,10 @@ class str(Sequence[str]):
def zfill(self, __width: SupportsIndex) -> str: ...
@staticmethod
@overload
def maketrans(__x: Dict[int, _T] | Dict[str, _T] | Dict[str | int, _T]) -> Dict[int, _T]: ...
def maketrans(__x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ...
@staticmethod
@overload
def maketrans(__x: str, __y: str, __z: str | None = ...) -> Dict[int, int | None]: ...
def maketrans(__x: str, __y: str, __z: str | None = ...) -> dict[int, int | None]: ...
def __add__(self, s: str) -> str: ...
# Incompatible with Sequence.__contains__
def __contains__(self, o: str) -> bool: ... # type: ignore
@@ -477,10 +475,10 @@ class bytes(ByteString):
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ...
def rpartition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> List[bytes]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
def rstrip(self, __bytes: bytes | None = ...) -> bytes: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> List[bytes]: ...
def splitlines(self, keepends: bool = ...) -> List[bytes]: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
def splitlines(self, keepends: bool = ...) -> list[bytes]: ...
def startswith(
self, __prefix: bytes | Tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> bool: ...
@@ -579,10 +577,10 @@ class bytearray(MutableSequence[int], ByteString):
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ...
def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> List[bytearray]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
def rstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> List[bytearray]: ...
def splitlines(self, keepends: bool = ...) -> List[bytearray]: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
def splitlines(self, keepends: bool = ...) -> list[bytearray]: ...
def startswith(
self, __prefix: bytes | Tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> bool: ...
@@ -644,7 +642,7 @@ class memoryview(Sized, Sequence[int]):
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
def cast(self, format: str, shape: List[int] | Tuple[int] = ...) -> memoryview: ...
def cast(self, format: str, shape: list[int] | Tuple[int] = ...) -> memoryview: ...
@overload
def __getitem__(self, i: SupportsIndex) -> int: ...
@overload
@@ -660,7 +658,7 @@ class memoryview(Sized, Sequence[int]):
def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ...
else:
def tobytes(self) -> bytes: ...
def tolist(self) -> List[int]: ...
def tolist(self) -> list[int]: ...
if sys.version_info >= (3, 8):
def toreadonly(self) -> memoryview: ...
def release(self) -> None: ...
@@ -739,7 +737,7 @@ class function:
__module__: str
__code__: CodeType
__qualname__: str
__annotations__: Dict[str, Any]
__annotations__: dict[str, Any]
class list(MutableSequence[_T], Generic[_T]):
@overload
@@ -747,7 +745,7 @@ class list(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self, iterable: Iterable[_T]) -> None: ...
def clear(self) -> None: ...
def copy(self) -> List[_T]: ...
def copy(self) -> list[_T]: ...
def append(self, __object: _T) -> None: ...
def extend(self, __iterable: Iterable[_T]) -> None: ...
def pop(self, __index: SupportsIndex = ...) -> _T: ...
@@ -757,7 +755,7 @@ class list(MutableSequence[_T], Generic[_T]):
def remove(self, __value: _T) -> None: ...
def reverse(self) -> None: ...
@overload
def sort(self: List[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
def sort(self: list[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> None: ...
def __len__(self) -> int: ...
@@ -767,38 +765,38 @@ class list(MutableSequence[_T], Generic[_T]):
@overload
def __getitem__(self, i: SupportsIndex) -> _T: ...
@overload
def __getitem__(self, s: slice) -> List[_T]: ...
def __getitem__(self, s: slice) -> list[_T]: ...
@overload
def __setitem__(self, i: SupportsIndex, o: _T) -> None: ...
@overload
def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ...
def __delitem__(self, i: SupportsIndex | slice) -> None: ...
def __add__(self, x: List[_T]) -> List[_T]: ...
def __add__(self, x: list[_T]) -> list[_T]: ...
def __iadd__(self: _S, x: Iterable[_T]) -> _S: ...
def __mul__(self, n: SupportsIndex) -> List[_T]: ...
def __rmul__(self, n: SupportsIndex) -> List[_T]: ...
def __mul__(self, n: SupportsIndex) -> list[_T]: ...
def __rmul__(self, n: SupportsIndex) -> list[_T]: ...
def __imul__(self: _S, n: SupportsIndex) -> _S: ...
def __contains__(self, o: object) -> bool: ...
def __reversed__(self) -> Iterator[_T]: ...
def __gt__(self, x: List[_T]) -> bool: ...
def __ge__(self, x: List[_T]) -> bool: ...
def __lt__(self, x: List[_T]) -> bool: ...
def __le__(self, x: List[_T]) -> bool: ...
def __gt__(self, x: list[_T]) -> bool: ...
def __ge__(self, x: list[_T]) -> bool: ...
def __lt__(self, x: list[_T]) -> bool: ...
def __le__(self, x: list[_T]) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self: Dict[_KT, _VT]) -> None: ...
def __init__(self: dict[_KT, _VT]) -> None: ...
@overload
def __init__(self: Dict[str, _VT], **kwargs: _VT) -> None: ...
def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
def clear(self) -> None: ...
def copy(self) -> Dict[_KT, _VT]: ...
def copy(self) -> dict[_KT, _VT]: ...
def popitem(self) -> Tuple[_KT, _VT]: ...
def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ...
@overload
@@ -827,9 +825,9 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
__hash__: None # type: ignore
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def __or__(self, __value: Mapping[_T1, _T2]) -> Dict[_KT | _T1, _VT | _T2]: ...
def __ror__(self, __value: Mapping[_T1, _T2]) -> Dict[_KT | _T1, _VT | _T2]: ...
def __ior__(self, __value: Mapping[_KT, _VT]) -> Dict[_KT, _VT]: ... # type: ignore
def __or__(self, __value: Mapping[_T1, _T2]) -> dict[_KT | _T1, _VT | _T2]: ...
def __ror__(self, __value: Mapping[_T1, _T2]) -> dict[_KT | _T1, _VT | _T2]: ...
def __ior__(self, __value: Mapping[_KT, _VT]) -> dict[_KT, _VT]: ... # type: ignore
class set(MutableSet[_T], Generic[_T]):
def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
@@ -998,16 +996,16 @@ else:
def copyright() -> None: ...
def credits() -> None: ...
def delattr(__obj: Any, __name: str) -> None: ...
def dir(__o: object = ...) -> List[str]: ...
def dir(__o: object = ...) -> list[str]: ...
@overload
def divmod(__x: SupportsDivMod[_T_contra, _T_co], __y: _T_contra) -> _T_co: ...
@overload
def divmod(__x: _T_contra, __y: SupportsRDivMod[_T_contra, _T_co]) -> _T_co: ...
def eval(
__source: str | bytes | CodeType, __globals: Dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ...
__source: str | bytes | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ...
) -> Any: ...
def exec(
__source: str | bytes | CodeType, __globals: Dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ...
__source: str | bytes | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ...
) -> Any: ...
def exit(code: object = ...) -> NoReturn: ...
@@ -1031,7 +1029,7 @@ def getattr(__o: object, name: str, __default: None) -> Any | None: ...
def getattr(__o: object, name: str, __default: bool) -> Any | bool: ...
@overload
def getattr(__o: object, name: str, __default: _T) -> Any | _T: ...
def globals() -> Dict[str, Any]: ...
def globals() -> dict[str, Any]: ...
def hasattr(__obj: object, __name: str) -> bool: ...
def hash(__obj: object) -> int: ...
def help(*args: Any, **kwds: Any) -> None: ...
@@ -1059,7 +1057,7 @@ else:
def len(__obj: Sized) -> int: ...
def license() -> None: ...
def locals() -> Dict[str, Any]: ...
def locals() -> dict[str, Any]: ...
class map(Iterator[_S], Generic[_S]):
@overload
@@ -1286,9 +1284,9 @@ def round(number: SupportsRound[Any], ndigits: None) -> int: ...
def round(number: SupportsRound[_T], ndigits: SupportsIndex) -> _T: ...
def setattr(__obj: object, __name: str, __value: Any) -> None: ...
@overload
def sorted(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> List[SupportsLessThanT]: ...
def sorted(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> list[SupportsLessThanT]: ...
@overload
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> List[_T]: ...
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> list[_T]: ...
if sys.version_info >= (3, 8):
@overload
@@ -1302,7 +1300,7 @@ else:
@overload
def sum(__iterable: Iterable[_T], __start: _S) -> _T | _S: ...
def vars(__object: Any = ...) -> Dict[str, Any]: ...
def vars(__object: Any = ...) -> dict[str, Any]: ...
class zip(Iterator[_T_co], Generic[_T_co]):
@overload

View File

@@ -2,7 +2,7 @@ import _compression
import sys
from _compression import BaseStream
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
from typing import IO, Any, Iterable, List, Protocol, TextIO, TypeVar, overload
from typing import IO, Any, Iterable, Protocol, TextIO, TypeVar, overload
from typing_extensions import Literal, SupportsIndex
# The following attributes and methods are optional:
@@ -113,7 +113,7 @@ class BZ2File(BaseStream, IO[bytes]):
def read1(self, size: int = ...) -> bytes: ...
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore
def readinto(self, b: WriteableBuffer) -> int: ...
def readlines(self, size: SupportsIndex = ...) -> List[bytes]: ...
def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def write(self, data: ReadableBuffer) -> int: ...
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...

View File

@@ -1,11 +1,11 @@
import sys
from _typeshed import Self, StrOrBytesPath
from types import CodeType
from typing import Any, Callable, Dict, Tuple, TypeVar
from typing import Any, Callable, Tuple, TypeVar
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
def runctx(
statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: str | None = ..., sort: str | int = ...
statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = ..., sort: str | int = ...
) -> None: ...
_T = TypeVar("_T")
@@ -23,7 +23,7 @@ class Profile:
def create_stats(self) -> None: ...
def snapshot_stats(self) -> None: ...
def run(self: Self, cmd: str) -> Self: ...
def runctx(self: Self, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> Self: ...
def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
if sys.version_info >= (3, 8):
def __enter__(self: Self) -> Self: ...

View File

@@ -1,7 +1,7 @@
import datetime
import sys
from time import struct_time
from typing import Any, Iterable, List, Optional, Sequence, Tuple
from typing import Any, Iterable, Optional, Sequence, Tuple
_LocaleType = Tuple[Optional[str], Optional[str]]
@@ -27,12 +27,12 @@ class Calendar:
def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ...
def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ...
def itermonthdays(self, year: int, month: int) -> Iterable[int]: ...
def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ...
def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ...
def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ...
def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ...
def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ...
def monthdays2calendar(self, year: int, month: int) -> list[list[Tuple[int, int]]]: ...
def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ...
def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> list[list[Tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
if sys.version_info >= (3, 7):
def itermonthdays3(self, year: int, month: int) -> Iterable[Tuple[int, int, int]]: ...
def itermonthdays4(self, year: int, month: int) -> Iterable[Tuple[int, int, int, int]]: ...
@@ -50,7 +50,7 @@ class TextCalendar(Calendar):
def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
def firstweekday() -> int: ...
def monthcalendar(year: int, month: int) -> List[List[int]]: ...
def monthcalendar(year: int, month: int) -> list[list[int]]: ...
def prweek(theweek: int, width: int) -> None: ...
def week(theweek: int, width: int) -> str: ...
def weekheader(width: int) -> str: ...
@@ -69,9 +69,9 @@ class HTMLCalendar(Calendar):
def formatyear(self, theyear: int, width: int = ...) -> str: ...
def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ...
if sys.version_info >= (3, 7):
cssclasses: List[str]
cssclasses: list[str]
cssclass_noday: str
cssclasses_weekday_head: List[str]
cssclasses_weekday_head: list[str]
cssclass_month_head: str
cssclass_month: str
cssclass_year: str

View File

@@ -1,6 +1,6 @@
from _typeshed import StrOrBytesPath
from types import FrameType, TracebackType
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type
from typing import IO, Any, Callable, Optional, Tuple, Type
_ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
@@ -8,10 +8,10 @@ def reset() -> str: ... # undocumented
def small(text: str) -> str: ... # undocumented
def strong(text: str) -> str: ... # undocumented
def grey(text: str) -> str: ... # undocumented
def lookup(name: str, frame: FrameType, locals: Dict[str, Any]) -> Tuple[str | None, Any]: ... # undocumented
def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> Tuple[str | None, Any]: ... # undocumented
def scanvars(
reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any]
) -> List[Tuple[str, str | None, Any]]: ... # undocumented
reader: Callable[[], bytes], frame: FrameType, locals: dict[str, Any]
) -> list[Tuple[str, str | None, Any]]: ... # undocumented
def html(einfo: _ExcInfo, context: int = ...) -> str: ...
def text(einfo: _ExcInfo, context: int = ...) -> str: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, List, Tuple
from typing import IO, Any, Callable, Tuple
class Cmd:
prompt: str
@@ -14,7 +14,7 @@ class Cmd:
use_rawinput: bool
stdin: IO[str]
stdout: IO[str]
cmdqueue: List[str]
cmdqueue: list[str]
completekey: str
def __init__(self, completekey: str = ..., stdin: IO[str] | None = ..., stdout: IO[str] | None = ...) -> None: ...
old_completer: Callable[[str, int], str | None] | None
@@ -27,13 +27,13 @@ class Cmd:
def onecmd(self, line: str) -> bool: ...
def emptyline(self) -> bool: ...
def default(self, line: str) -> bool: ...
def completedefault(self, *ignored: Any) -> List[str]: ...
def completenames(self, text: str, *ignored: Any) -> List[str]: ...
completion_matches: List[str] | None
def complete(self, text: str, state: int) -> List[str] | None: ...
def get_names(self) -> List[str]: ...
def completedefault(self, *ignored: Any) -> list[str]: ...
def completenames(self, text: str, *ignored: Any) -> list[str]: ...
completion_matches: list[str] | None
def complete(self, text: str, state: int) -> list[str] | None: ...
def get_names(self) -> list[str]: ...
# Only the first element of args matters.
def complete_help(self, *args: Any) -> List[str]: ...
def complete_help(self, *args: Any) -> list[str]: ...
def do_help(self, arg: str) -> bool | None: ...
def print_topics(self, header: str, cmds: List[str] | None, cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: List[str] | None, displaywidth: int = ...) -> None: ...
def print_topics(self, header: str, cmds: list[str] | None, cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: list[str] | None, displaywidth: int = ...) -> None: ...

View File

@@ -2,22 +2,7 @@ import sys
import types
from _typeshed import Self
from abc import abstractmethod
from typing import (
IO,
Any,
BinaryIO,
Callable,
Generator,
Iterable,
Iterator,
List,
Protocol,
TextIO,
Tuple,
Type,
TypeVar,
overload,
)
from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, Tuple, Type, TypeVar, overload
from typing_extensions import Literal
# TODO: this only satisfies the most common interface, where
@@ -204,7 +189,7 @@ class StreamReader(Codec):
def __init__(self, stream: IO[bytes], errors: str = ...) -> None: ...
def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> str: ...
def readline(self, size: int | None = ..., keepends: bool = ...) -> str: ...
def readlines(self, sizehint: int | None = ..., keepends: bool = ...) -> List[str]: ...
def readlines(self, sizehint: int | None = ..., keepends: bool = ...) -> list[str]: ...
def reset(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, typ: Type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
@@ -219,7 +204,7 @@ class StreamReaderWriter(TextIO):
def __init__(self, stream: IO[bytes], Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ...
def read(self, size: int = ...) -> str: ...
def readline(self, size: int | None = ...) -> str: ...
def readlines(self, sizehint: int | None = ...) -> List[str]: ...
def readlines(self, sizehint: int | None = ...) -> list[str]: ...
def __next__(self) -> str: ...
def __iter__(self: _T) -> _T: ...
# This actually returns None, but that's incompatible with the supertype
@@ -257,7 +242,7 @@ class StreamRecoder(BinaryIO):
) -> None: ...
def read(self, size: int = ...) -> bytes: ...
def readline(self, size: int | None = ...) -> bytes: ...
def readlines(self, sizehint: int | None = ...) -> List[bytes]: ...
def readlines(self, sizehint: int | None = ...) -> list[bytes]: ...
def __next__(self) -> bytes: ...
def __iter__(self: _SRT) -> _SRT: ...
def write(self, data: bytes) -> int: ...

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import Self
from typing import Any, Dict, Generic, List, NoReturn, Tuple, Type, TypeVar, overload
from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload
if sys.version_info >= (3, 10):
from typing import (
@@ -41,7 +41,7 @@ else:
) -> Type[Tuple[Any, ...]]: ...
class UserDict(MutableMapping[_KT, _VT]):
data: Dict[_KT, _VT]
data: dict[_KT, _VT]
def __init__(self, __dict: Mapping[_KT, _VT] | None = ..., **kwargs: _VT) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, key: _KT) -> _VT: ...
@@ -54,7 +54,7 @@ class UserDict(MutableMapping[_KT, _VT]):
def fromkeys(cls: Type[_S], iterable: Iterable[_KT], value: _VT | None = ...) -> _S: ...
class UserList(MutableSequence[_T]):
data: List[_T]
data: list[_T]
def __init__(self, initlist: Iterable[_T] | None = ...) -> None: ...
def __lt__(self, other: object) -> bool: ...
def __le__(self, other: object) -> bool: ...
@@ -138,10 +138,10 @@ class UserString(Sequence[str]):
def lstrip(self: _UserStringT, chars: str | None = ...) -> _UserStringT: ...
@staticmethod
@overload
def maketrans(x: Dict[int, _T] | Dict[str, _T] | Dict[str | int, _T]) -> Dict[int, _T]: ...
def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ...
@staticmethod
@overload
def maketrans(x: str, y: str, z: str = ...) -> Dict[int, int | None]: ...
def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ...
def partition(self, sep: str) -> Tuple[str, str, str]: ...
if sys.version_info >= (3, 9):
def removeprefix(self: _UserStringT, __prefix: str | UserString) -> _UserStringT: ...
@@ -152,9 +152,9 @@ class UserString(Sequence[str]):
def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
def rstrip(self: _UserStringT, chars: str | None = ...) -> _UserStringT: ...
def split(self, sep: str | None = ..., maxsplit: int = ...) -> List[str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> List[str]: ...
def splitlines(self, keepends: bool = ...) -> List[str]: ...
def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
def splitlines(self, keepends: bool = ...) -> list[str]: ...
def startswith(self, prefix: str | Tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
def strip(self: _UserStringT, chars: str | None = ...) -> _UserStringT: ...
def swapcase(self: _UserStringT) -> _UserStringT: ...
@@ -214,7 +214,7 @@ class Counter(Dict[_T, int], Generic[_T]):
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def copy(self: _S) -> _S: ...
def elements(self) -> Iterator[_T]: ...
def most_common(self, n: int | None = ...) -> List[Tuple[_T, int]]: ...
def most_common(self, n: int | None = ...) -> list[Tuple[_T, int]]: ...
@classmethod
def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore
@overload
@@ -284,7 +284,7 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
def copy(self: _S) -> _S: ...
class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
maps: List[Mapping[_KT, _VT]]
maps: list[Mapping[_KT, _VT]]
def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ...
def new_child(self, m: Mapping[_KT, _VT] | None = ...) -> ChainMap[_KT, _VT]: ...
@property

View File

@@ -3,7 +3,7 @@ import threading
from _typeshed import Self
from abc import abstractmethod
from logging import Logger
from typing import Any, Callable, Container, Generic, Iterable, Iterator, List, Protocol, Sequence, Set, TypeVar, overload
from typing import Any, Callable, Container, Generic, Iterable, Iterator, Protocol, Sequence, Set, TypeVar, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -86,7 +86,7 @@ def wait(fs: Iterable[Future[_T]], timeout: float | None = ..., return_when: str
class _Waiter:
event: threading.Event
finished_futures: List[Future[Any]]
finished_futures: list[Future[Any]]
def __init__(self) -> None: ...
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...

View File

@@ -8,7 +8,6 @@ from typing import (
Dict,
Iterable,
Iterator,
List,
Mapping,
MutableMapping,
Optional,
@@ -98,12 +97,12 @@ class RawConfigParser(_parser):
def __delitem__(self, section: str) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def defaults(self) -> _section: ...
def sections(self) -> List[str]: ...
def sections(self) -> list[str]: ...
def add_section(self, section: str) -> None: ...
def has_section(self, section: str) -> bool: ...
def options(self, section: str) -> List[str]: ...
def options(self, section: str) -> list[str]: ...
def has_option(self, section: str, option: str) -> bool: ...
def read(self, filenames: _Path | Iterable[_Path], encoding: str | None = ...) -> List[str]: ...
def read(self, filenames: _Path | Iterable[_Path], encoding: str | None = ...) -> list[str]: ...
def read_file(self, f: Iterable[str], source: str | None = ...) -> None: ...
def read_string(self, string: str, source: str = ...) -> None: ...
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = ...) -> None: ...
@@ -146,7 +145,7 @@ class RawConfigParser(_parser):
@overload
def items(self, *, raw: bool = ..., vars: _section | None = ...) -> AbstractSet[Tuple[str, SectionProxy]]: ...
@overload
def items(self, section: str, raw: bool = ..., vars: _section | None = ...) -> List[Tuple[str, str]]: ...
def items(self, section: str, raw: bool = ..., vars: _section | None = ...) -> list[Tuple[str, str]]: ...
def set(self, section: str, option: str, value: str | None = ...) -> None: ...
def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = ...) -> None: ...
def remove_option(self, section: str, option: str) -> bool: ...
@@ -237,7 +236,7 @@ class InterpolationSyntaxError(InterpolationError): ...
class ParsingError(Error):
source: str
errors: List[Tuple[int, str]]
errors: list[Tuple[int, str]]
def __init__(self, source: str | None = ..., filename: str | None = ...) -> None: ...
def append(self, lineno: int, line: str) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Dict, TypeVar
from typing import Any, TypeVar
_T = TypeVar("_T")
@@ -6,7 +6,7 @@ _T = TypeVar("_T")
PyStringMap: Any
# Note: memo and _nil are internal kwargs.
def deepcopy(x: _T, memo: Dict[int, Any] | None = ..., _nil: Any = ...) -> _T: ...
def deepcopy(x: _T, memo: dict[int, Any] | None = ..., _nil: Any = ...) -> _T: ...
def copy(x: _T) -> _T: ...
class Error(Exception): ...

View File

@@ -1,9 +1,9 @@
from typing import Any, Callable, Hashable, List, Optional, SupportsInt, Tuple, TypeVar, Union
from typing import Any, Callable, Hashable, Optional, SupportsInt, Tuple, TypeVar, Union
_TypeT = TypeVar("_TypeT", bound=type)
_Reduce = Union[Tuple[Callable[..., _TypeT], Tuple[Any, ...]], Tuple[Callable[..., _TypeT], Tuple[Any, ...], Optional[Any]]]
__all__: List[str]
__all__: list[str]
def pickle(
ob_type: _TypeT,

View File

@@ -1,5 +1,4 @@
import sys
from typing import List
class _Method: ...
@@ -10,7 +9,7 @@ METHOD_SHA512: _Method
if sys.version_info >= (3, 7):
METHOD_BLOWFISH: _Method
methods: List[_Method]
methods: list[_Method]
if sys.version_info >= (3, 7):
def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ...

View File

@@ -17,7 +17,7 @@ from _csv import (
unregister_dialect as unregister_dialect,
writer as writer,
)
from typing import Any, Generic, Iterable, Iterator, List, Mapping, Sequence, Type, TypeVar, overload
from typing import Any, Generic, Iterable, Iterator, Mapping, Sequence, Type, TypeVar, overload
if sys.version_info >= (3, 8):
from typing import Dict as _DictReadMapping
@@ -100,7 +100,7 @@ class DictWriter(Generic[_T]):
def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ...
class Sniffer(object):
preferred: List[str]
preferred: list[str]
def __init__(self) -> None: ...
def sniff(self, sample: str, delimiters: str | None = ...) -> Type[Dialect]: ...
def has_header(self, sample: str) -> bool: ...

View File

@@ -7,7 +7,6 @@ from typing import (
Generic,
Iterable,
Iterator,
List,
Mapping,
Optional,
Sequence,
@@ -187,7 +186,7 @@ class pointer(Generic[_CT], _PointerLike, _CData):
@overload
def __getitem__(self, i: int) -> _CT: ...
@overload
def __getitem__(self, s: slice) -> List[_CT]: ...
def __getitem__(self, s: slice) -> list[_CT]: ...
@overload
def __setitem__(self, i: int, o: _CT) -> None: ...
@overload
@@ -296,7 +295,7 @@ class Array(Generic[_CT], _CData):
@overload
def __getitem__(self, i: int) -> Any: ...
@overload
def __getitem__(self, s: slice) -> List[Any]: ...
def __getitem__(self, s: slice) -> list[Any]: ...
@overload
def __setitem__(self, i: int, o: Any) -> None: ...
@overload

View File

@@ -1,4 +1,4 @@
from typing import List, TypeVar
from typing import TypeVar
_CharT = TypeVar("_CharT", str, int)
@@ -39,7 +39,7 @@ US: int
SP: int
DEL: int
controlnames: List[int]
controlnames: list[int]
def isalnum(c: str | int) -> bool: ...
def isalpha(c: str | int) -> bool: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Tuple, Type, TypeVar, overload
from typing import Any, Callable, Generic, Iterable, Mapping, Tuple, Type, TypeVar, overload
from typing_extensions import Protocol
if sys.version_info >= (3, 9):
@@ -16,13 +16,13 @@ if sys.version_info >= (3, 10):
class KW_ONLY: ...
@overload
def asdict(obj: Any) -> Dict[str, Any]: ...
def asdict(obj: Any) -> dict[str, Any]: ...
@overload
def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ...
def asdict(obj: Any, *, dict_factory: Callable[[list[Tuple[str, Any]]], _T]) -> _T: ...
@overload
def astuple(obj: Any) -> Tuple[Any, ...]: ...
@overload
def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ...
def astuple(obj: Any, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ...
if sys.version_info >= (3, 10):
@overload
@@ -192,7 +192,7 @@ if sys.version_info >= (3, 10):
fields: Iterable[str | Tuple[str, type] | Tuple[str, type, Field[Any]]],
*,
bases: Tuple[type, ...] = ...,
namespace: Dict[str, Any] | None = ...,
namespace: dict[str, Any] | None = ...,
init: bool = ...,
repr: bool = ...,
eq: bool = ...,
@@ -209,7 +209,7 @@ else:
fields: Iterable[str | Tuple[str, type] | Tuple[str, type, Field[Any]]],
*,
bases: Tuple[type, ...] = ...,
namespace: Dict[str, Any] | None = ...,
namespace: dict[str, Any] | None = ...,
init: bool = ...,
repr: bool = ...,
eq: bool = ...,

View File

@@ -1,6 +1,6 @@
from _typeshed import Self
from types import TracebackType
from typing import List, Type, TypeVar, Union, overload
from typing import Type, TypeVar, Union, overload
_T = TypeVar("_T")
_KeyType = Union[str, bytes]
@@ -28,7 +28,7 @@ class _gdbm:
def get(self, k: _KeyType) -> bytes | None: ...
@overload
def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ...
def keys(self) -> List[bytes]: ...
def keys(self) -> list[bytes]: ...
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
# Don't exist at runtime
__new__: None # type: ignore

View File

@@ -1,6 +1,6 @@
from _typeshed import Self
from types import TracebackType
from typing import List, Type, TypeVar, Union, overload
from typing import Type, TypeVar, Union, overload
_T = TypeVar("_T")
_KeyType = Union[str, bytes]
@@ -26,7 +26,7 @@ class _dbm:
def get(self, k: _KeyType) -> bytes | None: ...
@overload
def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ...
def keys(self) -> List[bytes]: ...
def keys(self) -> list[bytes]: ...
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
# Don't exist at runtime
__new__: None # type: ignore

View File

@@ -1,6 +1,6 @@
import numbers
from types import TracebackType
from typing import Any, Container, Dict, List, NamedTuple, Sequence, Tuple, Type, TypeVar, Union, overload
from typing import Any, Container, NamedTuple, Sequence, Tuple, Type, TypeVar, Union, overload
_Decimal = Union[Decimal, int]
_DecimalNew = Union[Decimal, float, str, Tuple[int, Sequence[int], int]]
@@ -164,8 +164,8 @@ class Context(object):
Emax: int
capitals: int
clamp: int
traps: Dict[_TrapType, bool]
flags: Dict[_TrapType, bool]
traps: dict[_TrapType, bool]
flags: dict[_TrapType, bool]
def __init__(
self,
prec: int | None = ...,
@@ -174,9 +174,9 @@ class Context(object):
Emax: int | None = ...,
capitals: int | None = ...,
clamp: int | None = ...,
flags: None | Dict[_TrapType, bool] | Container[_TrapType] = ...,
traps: None | Dict[_TrapType, bool] | Container[_TrapType] = ...,
_ignored_flags: List[_TrapType] | None = ...,
flags: None | dict[_TrapType, bool] | Container[_TrapType] = ...,
traps: None | dict[_TrapType, bool] | Container[_TrapType] = ...,
_ignored_flags: list[_TrapType] | None = ...,
) -> None: ...
# __setattr__() only allows to set a specific set of attributes,
# already defined above.

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, TypeVar, Union, overload
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTuple, Sequence, Tuple, TypeVar, Union, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -23,9 +23,9 @@ class SequenceMatcher(Generic[_T]):
def find_longest_match(self, alo: int = ..., ahi: int | None = ..., blo: int = ..., bhi: int | None = ...) -> Match: ...
else:
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
def get_matching_blocks(self) -> List[Match]: ...
def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[List[Tuple[str, int, int, int, int]]]: ...
def get_matching_blocks(self) -> list[Match]: ...
def get_opcodes(self) -> list[Tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[Tuple[str, int, int, int, int]]]: ...
def ratio(self) -> float: ...
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...
@@ -36,11 +36,11 @@ class SequenceMatcher(Generic[_T]):
@overload
def get_close_matches( # type: ignore
word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...
) -> List[AnyStr]: ...
) -> list[AnyStr]: ...
@overload
def get_close_matches(
word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ...
) -> List[Sequence[_T]]: ...
) -> list[Sequence[_T]]: ...
class Differ:
def __init__(self, linejunk: _JunkCallback | None = ..., charjunk: _JunkCallback | None = ...) -> None: ...

View File

@@ -16,7 +16,7 @@ from opcode import (
opname as opname,
stack_effect as stack_effect,
)
from typing import IO, Any, Callable, Dict, Iterator, List, NamedTuple, Tuple, Union
from typing import IO, Any, Callable, Iterator, NamedTuple, Tuple, Union
# Strictly this should not have to include Callable, but mypy doesn't use FunctionType
# for functions (python/mypy#3171)
@@ -44,9 +44,9 @@ class Bytecode:
@classmethod
def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ...
COMPILER_FLAG_NAMES: Dict[int, str]
COMPILER_FLAG_NAMES: dict[int, str]
def findlabels(code: _have_code) -> List[int]: ...
def findlabels(code: _have_code) -> list[int]: ...
def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
def pretty_flags(flags: int) -> str: ...
def code_info(x: _have_code_or_string) -> str: ...

View File

@@ -1,11 +1,11 @@
from typing import Any, Callable, List, Optional, Tuple, Union
from typing import Any, Callable, Optional, Tuple, Union
_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]
) -> List[str]: ...
def gen_preprocess_options(macros: List[_Macro], include_dirs: List[str]) -> List[str]: ...
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ...
def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ...
def new_compiler(
plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ...
@@ -17,34 +17,34 @@ class CCompiler:
force: bool
verbose: bool
output_dir: str | None
macros: List[_Macro]
include_dirs: List[str]
libraries: List[str]
library_dirs: List[str]
runtime_library_dirs: List[str]
objects: List[str]
macros: list[_Macro]
include_dirs: list[str]
libraries: list[str]
library_dirs: list[str]
runtime_library_dirs: list[str]
objects: list[str]
def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ...
def add_include_dir(self, dir: str) -> None: ...
def set_include_dirs(self, dirs: List[str]) -> None: ...
def set_include_dirs(self, dirs: list[str]) -> None: ...
def add_library(self, libname: str) -> None: ...
def set_libraries(self, libnames: List[str]) -> None: ...
def set_libraries(self, libnames: list[str]) -> None: ...
def add_library_dir(self, dir: str) -> None: ...
def set_library_dirs(self, dirs: List[str]) -> None: ...
def set_library_dirs(self, dirs: list[str]) -> None: ...
def add_runtime_library_dir(self, dir: str) -> None: ...
def set_runtime_library_dirs(self, dirs: List[str]) -> None: ...
def set_runtime_library_dirs(self, dirs: list[str]) -> None: ...
def define_macro(self, name: str, value: str | None = ...) -> None: ...
def undefine_macro(self, name: str) -> None: ...
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: List[str]) -> None: ...
def detect_language(self, sources: str | List[str]) -> str | None: ...
def find_library_file(self, dirs: List[str], lib: str, debug: bool = ...) -> str | None: ...
def set_link_objects(self, objects: list[str]) -> None: ...
def detect_language(self, sources: str | list[str]) -> str | None: ...
def find_library_file(self, dirs: list[str], lib: str, debug: bool = ...) -> str | None: ...
def has_function(
self,
funcname: str,
includes: List[str] | None = ...,
include_dirs: List[str] | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
includes: list[str] | None = ...,
include_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
) -> bool: ...
def library_dir_option(self, dir: str) -> str: ...
def library_option(self, lib: str) -> str: ...
@@ -52,18 +52,18 @@ class CCompiler:
def set_executables(self, **args: str) -> None: ...
def compile(
self,
sources: List[str],
sources: list[str],
output_dir: str | None = ...,
macros: _Macro | None = ...,
include_dirs: List[str] | None = ...,
include_dirs: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
depends: List[str] | None = ...,
) -> List[str]: ...
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
depends: list[str] | None = ...,
) -> list[str]: ...
def create_static_lib(
self,
objects: List[str],
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
debug: bool = ...,
@@ -72,59 +72,59 @@ class CCompiler:
def link(
self,
target_desc: str,
objects: List[str],
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
export_symbols: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_executable(
self,
objects: List[str],
objects: list[str],
output_progname: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_shared_lib(
self,
objects: List[str],
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
export_symbols: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_shared_object(
self,
objects: List[str],
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
export_symbols: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
@@ -132,17 +132,17 @@ class CCompiler:
self,
source: str,
output_file: str | None = ...,
macros: List[_Macro] | None = ...,
include_dirs: List[str] | None = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
macros: list[_Macro] | None = ...,
include_dirs: list[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
) -> None: ...
def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
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 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 spawn(self, cmd: List[str]) -> 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: ...
def announce(self, msg: str, level: int = ...) -> None: ...

View File

@@ -1,9 +1,9 @@
from abc import abstractmethod
from distutils.dist import Distribution
from typing import Any, Callable, Iterable, List, Tuple
from typing import Any, Callable, Iterable, Tuple
class Command:
sub_commands: List[Tuple[str, Callable[[Command], bool] | None]]
sub_commands: list[Tuple[str, Callable[[Command], bool] | None]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@@ -14,7 +14,7 @@ class Command:
def announce(self, msg: str, level: int = ...) -> None: ...
def debug_print(self, msg: str) -> None: ...
def ensure_string(self, option: str, default: str | None = ...) -> None: ...
def ensure_string_list(self, option: str | List[str]) -> None: ...
def ensure_string_list(self, option: str | list[str]) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
@@ -22,7 +22,7 @@ class Command:
def get_finalized_command(self, command: str, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = ...) -> Command: ...
def run_command(self, command: str) -> None: ...
def get_sub_commands(self) -> List[str]: ...
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
@@ -43,7 +43,7 @@ class Command:
preserve_times: int = ...,
preserve_symlinks: int = ...,
level: Any = ...,
) -> List[str]: ... # level is not used
) -> list[str]: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
def make_archive(
@@ -57,10 +57,10 @@ class Command:
) -> str: ...
def make_file(
self,
infiles: str | List[str] | Tuple[str],
infiles: str | list[str] | Tuple[str],
outfile: str,
func: Callable[..., Any],
args: List[Any],
args: list[Any],
exec_msg: str | None = ...,
skip_msg: str | None = ...,
level: Any = ...,

View File

@@ -1,7 +1,7 @@
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any, List, Mapping, Tuple, Type
from typing import Any, Mapping, Tuple, Type
def setup(
*,
@@ -15,34 +15,34 @@ def setup(
maintainer_email: str = ...,
url: str = ...,
download_url: str = ...,
packages: List[str] = ...,
py_modules: List[str] = ...,
scripts: List[str] = ...,
ext_modules: List[Extension] = ...,
classifiers: List[str] = ...,
packages: list[str] = ...,
py_modules: list[str] = ...,
scripts: list[str] = ...,
ext_modules: list[Extension] = ...,
classifiers: list[str] = ...,
distclass: Type[Distribution] = ...,
script_name: str = ...,
script_args: List[str] = ...,
script_args: list[str] = ...,
options: Mapping[str, Any] = ...,
license: str = ...,
keywords: List[str] | str = ...,
platforms: List[str] | str = ...,
keywords: list[str] | str = ...,
platforms: list[str] | str = ...,
cmdclass: Mapping[str, Type[Command]] = ...,
data_files: List[Tuple[str, List[str]]] = ...,
data_files: list[Tuple[str, list[str]]] = ...,
package_dir: Mapping[str, str] = ...,
obsoletes: List[str] = ...,
provides: List[str] = ...,
requires: List[str] = ...,
command_packages: List[str] = ...,
obsoletes: list[str] = ...,
provides: list[str] = ...,
requires: list[str] = ...,
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ...,
package_data: Mapping[str, List[str]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool = ...,
libraries: List[str] = ...,
headers: List[str] = ...,
libraries: list[str] = ...,
headers: list[str] = ...,
ext_package: str = ...,
include_dirs: List[str] = ...,
include_dirs: list[str] = ...,
password: str = ...,
fullname: str = ...,
**attrs: Any,
) -> None: ...
def run_setup(script_name: str, script_args: List[str] | None = ..., stop_after: str = ...) -> Distribution: ...
def run_setup(script_name: str, script_args: list[str] | None = ..., stop_after: str = ...) -> Distribution: ...

View File

@@ -1,5 +1,5 @@
from typing import List, Tuple
from typing import Tuple
def newer(source: str, target: str) -> bool: ...
def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ...
def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ...
def newer_pairwise(sources: list[str], targets: list[str]) -> list[Tuple[str, str]]: ...
def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ...

View File

@@ -1,7 +1,5 @@
from typing import List
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ...
def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ...
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ...
def copy_tree(
src: str,
dst: str,
@@ -11,5 +9,5 @@ def copy_tree(
update: int = ...,
verbose: int = ...,
dry_run: int = ...,
) -> List[str]: ...
) -> list[str]: ...
def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import StrOrBytesPath, SupportsWrite
from distutils.cmd import Command
from typing import IO, Any, Dict, Iterable, List, Mapping, Tuple, Type
from typing import IO, Any, Iterable, Mapping, Tuple, Type
class DistributionMetadata:
def __init__(self, path: int | StrOrBytesPath | None = ...) -> None: ...
@@ -14,13 +14,13 @@ class DistributionMetadata:
license: str | None
description: str | None
long_description: str | None
keywords: str | List[str] | None
platforms: str | List[str] | None
classifiers: str | List[str] | None
keywords: str | list[str] | None
platforms: str | list[str] | None
classifiers: str | list[str] | None
download_url: str | None
provides: List[str] | None
requires: List[str] | None
obsoletes: List[str] | None
provides: list[str] | None
requires: list[str] | None
obsoletes: list[str] | None
def read_pkg_file(self, file: IO[str]) -> None: ...
def write_pkg_info(self, base_dir: str) -> None: ...
def write_pkg_file(self, file: SupportsWrite[str]) -> None: ...
@@ -38,21 +38,21 @@ class DistributionMetadata:
def get_licence(self) -> str: ...
def get_description(self) -> str: ...
def get_long_description(self) -> str: ...
def get_keywords(self) -> str | List[str]: ...
def get_platforms(self) -> str | List[str]: ...
def get_classifiers(self) -> str | List[str]: ...
def get_keywords(self) -> str | list[str]: ...
def get_platforms(self) -> str | list[str]: ...
def get_classifiers(self) -> str | list[str]: ...
def get_download_url(self) -> str: ...
def get_requires(self) -> List[str]: ...
def get_requires(self) -> list[str]: ...
def set_requires(self, value: Iterable[str]) -> None: ...
def get_provides(self) -> List[str]: ...
def get_provides(self) -> list[str]: ...
def set_provides(self, value: Iterable[str]) -> None: ...
def get_obsoletes(self) -> List[str]: ...
def get_obsoletes(self) -> list[str]: ...
def set_obsoletes(self, value: Iterable[str]) -> None: ...
class Distribution:
cmdclass: Dict[str, Type[Command]]
cmdclass: dict[str, Type[Command]]
metadata: DistributionMetadata
def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ...
def get_option_dict(self, command: str) -> Dict[str, Tuple[str, str]]: ...
def get_option_dict(self, command: str) -> dict[str, Tuple[str, str]]: ...
def parse_config_files(self, filenames: Iterable[str] | None = ...) -> None: ...
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...

View File

@@ -1,22 +1,22 @@
from typing import List, Tuple
from typing import Tuple
class Extension:
def __init__(
self,
name: str,
sources: List[str],
include_dirs: List[str] | None = ...,
define_macros: List[Tuple[str, str | None]] | None = ...,
undef_macros: List[str] | None = ...,
library_dirs: List[str] | None = ...,
libraries: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
extra_objects: List[str] | None = ...,
extra_compile_args: List[str] | None = ...,
extra_link_args: List[str] | None = ...,
export_symbols: List[str] | None = ...,
sources: list[str],
include_dirs: list[str] | None = ...,
define_macros: list[Tuple[str, str | None]] | None = ...,
undef_macros: list[str] | None = ...,
library_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
extra_objects: list[str] | None = ...,
extra_compile_args: list[str] | None = ...,
extra_link_args: list[str] | None = ...,
export_symbols: list[str] | None = ...,
swig_opts: str | None = ..., # undocumented
depends: List[str] | None = ...,
depends: list[str] | None = ...,
language: str | None = ...,
optional: bool | None = ...,
) -> None: ...

View File

@@ -4,19 +4,19 @@ _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
) -> List[str] | _GR: ...
def wrap_text(text: str, width: int) -> List[str]: ...
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
) -> list[str] | _GR: ...
def wrap_text(text: str, width: int) -> list[str]: ...
class FancyGetopt:
def __init__(self, option_table: List[_Option] | None = ...) -> None: ...
def __init__(self, option_table: list[_Option] | None = ...) -> None: ...
# TODO kinda wrong, `getopt(object=object())` is invalid
@overload
def getopt(self, args: List[str] | None = ...) -> _GR: ...
def getopt(self, args: list[str] | None = ...) -> _GR: ...
@overload
def getopt(self, args: List[str] | None, object: Any) -> List[str]: ...
def get_option_order(self) -> List[Tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> List[str]: ...
def getopt(self, args: list[str] | None, object: Any) -> list[str]: ...
def get_option_order(self) -> list[Tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> list[str]: ...
class OptionDummy:
def __init__(self, options: Iterable[str] = ...) -> None: ...

View File

@@ -1,10 +1,10 @@
from typing import Iterable, List, Pattern, overload
from typing import Iterable, Pattern, overload
from typing_extensions import Literal
# class is entirely undocumented
class FileList:
allfiles: Iterable[str] | None = ...
files: List[str] = ...
files: list[str] = ...
def __init__(self, warn: None = ..., debug_print: None = ...) -> None: ...
def set_allfiles(self, allfiles: Iterable[str]) -> None: ...
def findall(self, dir: str = ...) -> None: ...
@@ -35,7 +35,7 @@ class FileList:
self, pattern: str | Pattern[str], anchor: int | bool = ..., prefix: str | None = ..., is_regex: int | bool = ...
) -> bool: ...
def findall(dir: str = ...) -> List[str]: ...
def findall(dir: str = ...) -> list[str]: ...
def glob_to_re(pattern: str) -> str: ...
@overload
def translate_pattern(

View File

@@ -1,4 +1,2 @@
from typing import List
def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...
def spawn(cmd: list[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...
def find_executable(executable: str, path: str | None = ...) -> str | None: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, List, Tuple
from typing import IO, Tuple
class TextFile:
def __init__(
@@ -15,7 +15,7 @@ class TextFile:
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...
def warn(self, msg: str, line: List[int] | Tuple[int, int] | int | None = ...) -> None: ...
def warn(self, msg: str, line: list[int] | Tuple[int, int] | int | None = ...) -> None: ...
def readline(self) -> str | None: ...
def readlines(self) -> List[str]: ...
def readlines(self) -> list[str]: ...
def unreadline(self, line: str) -> str: ...

View File

@@ -1,12 +1,12 @@
import types
import unittest
from typing import Any, Callable, Dict, List, NamedTuple, Tuple, Type
from typing import Any, Callable, NamedTuple, Tuple, Type
class TestResults(NamedTuple):
failed: int
attempted: int
OPTIONFLAGS_BY_NAME: Dict[str, int]
OPTIONFLAGS_BY_NAME: dict[str, int]
def register_optionflag(name: str) -> int: ...
@@ -36,7 +36,7 @@ class Example:
exc_msg: str | None
lineno: int
indent: int
options: Dict[int, bool]
options: dict[int, bool]
def __init__(
self,
source: str,
@@ -44,21 +44,21 @@ class Example:
exc_msg: str | None = ...,
lineno: int = ...,
indent: int = ...,
options: Dict[int, bool] | None = ...,
options: dict[int, bool] | None = ...,
) -> None: ...
def __hash__(self) -> int: ...
class DocTest:
examples: List[Example]
globs: Dict[str, Any]
examples: list[Example]
globs: dict[str, Any]
name: str
filename: str | None
lineno: int | None
docstring: str | None
def __init__(
self,
examples: List[Example],
globs: Dict[str, Any],
examples: list[Example],
globs: dict[str, Any],
name: str,
filename: str | None,
lineno: int | None,
@@ -68,9 +68,9 @@ class DocTest:
def __lt__(self, other: DocTest) -> bool: ...
class DocTestParser:
def parse(self, string: str, name: str = ...) -> List[str | Example]: ...
def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ...
def get_examples(self, string: str, name: str = ...) -> List[Example]: ...
def parse(self, string: str, name: str = ...) -> list[str | Example]: ...
def get_doctest(self, string: str, globs: dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ...
def get_examples(self, string: str, name: str = ...) -> list[Example]: ...
class DocTestFinder:
def __init__(
@@ -81,9 +81,9 @@ class DocTestFinder:
obj: object,
name: str | None = ...,
module: None | bool | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
extraglobs: Dict[str, Any] | None = ...,
) -> List[DocTest]: ...
globs: dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
) -> list[DocTest]: ...
_Out = Callable[[str], Any]
_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType]
@@ -129,11 +129,11 @@ master: DocTestRunner | None
def testmod(
m: types.ModuleType | None = ...,
name: str | None = ...,
globs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
verbose: bool | None = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: Dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
raise_on_error: bool = ...,
exclude_empty: bool = ...,
) -> TestResults: ...
@@ -142,17 +142,17 @@ def testfile(
module_relative: bool = ...,
name: str | None = ...,
package: None | str | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
verbose: bool | None = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: Dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
raise_on_error: bool = ...,
parser: DocTestParser = ...,
encoding: str | None = ...,
) -> TestResults: ...
def run_docstring_examples(
f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ..., compileflags: int | None = ..., optionflags: int = ...
f: object, globs: dict[str, Any], verbose: bool = ..., name: str = ..., compileflags: int | None = ..., optionflags: int = ...
) -> None: ...
def set_unittest_reportflags(flags: int) -> int: ...
@@ -184,8 +184,8 @@ class _DocTestSuite(unittest.TestSuite): ...
def DocTestSuite(
module: None | str | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
extraglobs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
test_finder: DocTestFinder | None = ...,
**options: Any,
) -> _DocTestSuite: ...
@@ -198,7 +198,7 @@ def DocFileTest(
path: str,
module_relative: bool = ...,
package: None | str | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
parser: DocTestParser = ...,
encoding: str | None = ...,
**options: Any,
@@ -206,6 +206,6 @@ def DocFileTest(
def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ...
def script_from_examples(s: str) -> str: ...
def testsource(module: None | str | types.ModuleType, name: str) -> str: ...
def debug_src(src: str, pm: bool = ..., globs: Dict[str, Any] | None = ...) -> None: ...
def debug_script(src: str, pm: bool = ..., globs: Dict[str, Any] | None = ...) -> None: ...
def debug_src(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ...
def debug_script(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ...
def debug(module: None | str | types.ModuleType, name: str, pm: bool = ...) -> None: ...

View File

@@ -27,17 +27,17 @@ class TokenList(List[Union[TokenList, Terminal]]):
token_type: str | None = ...
syntactic_break: bool = ...
ew_combine_allowed: bool = ...
defects: List[MessageDefect] = ...
defects: list[MessageDefect] = ...
def __init__(self, *args: Any, **kw: Any) -> None: ...
@property
def value(self) -> str: ...
@property
def all_defects(self) -> List[MessageDefect]: ...
def all_defects(self) -> list[MessageDefect]: ...
def startswith_fws(self) -> bool: ...
@property
def as_ew_allowed(self) -> bool: ...
@property
def comments(self) -> List[str]: ...
def comments(self) -> list[str]: ...
def fold(self, *, policy: Policy) -> str: ...
def pprint(self, indent: str = ...) -> None: ...
def ppstr(self, indent: str = ...) -> str: ...
@@ -46,7 +46,7 @@ class WhiteSpaceTokenList(TokenList):
@property
def value(self) -> str: ...
@property
def comments(self) -> List[str]: ...
def comments(self) -> list[str]: ...
class UnstructuredTokenList(TokenList):
token_type: str = ...
@@ -93,46 +93,46 @@ class Comment(WhiteSpaceTokenList):
@property
def content(self) -> str: ...
@property
def comments(self) -> List[str]: ...
def comments(self) -> list[str]: ...
class AddressList(TokenList):
token_type: str = ...
@property
def addresses(self) -> List[Address]: ...
def addresses(self) -> list[Address]: ...
@property
def mailboxes(self) -> List[Mailbox]: ...
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> List[Mailbox]: ...
def all_mailboxes(self) -> list[Mailbox]: ...
class Address(TokenList):
token_type: str = ...
@property
def display_name(self) -> str: ...
@property
def mailboxes(self) -> List[Mailbox]: ...
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> List[Mailbox]: ...
def all_mailboxes(self) -> list[Mailbox]: ...
class MailboxList(TokenList):
token_type: str = ...
@property
def mailboxes(self) -> List[Mailbox]: ...
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> List[Mailbox]: ...
def all_mailboxes(self) -> list[Mailbox]: ...
class GroupList(TokenList):
token_type: str = ...
@property
def mailboxes(self) -> List[Mailbox]: ...
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> List[Mailbox]: ...
def all_mailboxes(self) -> list[Mailbox]: ...
class Group(TokenList):
token_type: str = ...
@property
def mailboxes(self) -> List[Mailbox]: ...
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> List[Mailbox]: ...
def all_mailboxes(self) -> list[Mailbox]: ...
@property
def display_name(self) -> str: ...
@@ -145,7 +145,7 @@ class NameAddr(TokenList):
@property
def domain(self) -> str: ...
@property
def route(self) -> List[Domain] | None: ...
def route(self) -> list[Domain] | None: ...
@property
def addr_spec(self) -> str: ...
@@ -156,14 +156,14 @@ class AngleAddr(TokenList):
@property
def domain(self) -> str: ...
@property
def route(self) -> List[Domain] | None: ...
def route(self) -> list[Domain] | None: ...
@property
def addr_spec(self) -> str: ...
class ObsRoute(TokenList):
token_type: str = ...
@property
def domains(self) -> List[Domain]: ...
def domains(self) -> list[Domain]: ...
class Mailbox(TokenList):
token_type: str = ...
@@ -174,7 +174,7 @@ class Mailbox(TokenList):
@property
def domain(self) -> str: ...
@property
def route(self) -> List[str]: ...
def route(self) -> list[str]: ...
@property
def addr_spec(self) -> str: ...
@@ -326,14 +326,14 @@ class Terminal(str):
ew_combine_allowed: bool = ...
syntactic_break: bool = ...
token_type: str = ...
defects: List[MessageDefect] = ...
defects: list[MessageDefect] = ...
def __new__(cls: Type[_T], value: str, token_type: str) -> _T: ...
def pprint(self) -> None: ...
@property
def all_defects(self) -> List[MessageDefect]: ...
def all_defects(self) -> list[MessageDefect]: ...
def pop_trailing_ws(self) -> None: ...
@property
def comments(self) -> List[str]: ...
def comments(self) -> list[str]: ...
def __getnewargs__(self) -> Tuple[str, str]: ... # type: ignore
class WhiteSpaceTerminal(Terminal):

View File

@@ -1,4 +1,4 @@
from typing import Any, Iterator, List
from typing import Any, Iterator
QP: int # undocumented
BASE64: int # undocumented
@@ -15,7 +15,7 @@ class Charset:
def get_body_encoding(self) -> str: ...
def get_output_charset(self) -> str | None: ...
def header_encode(self, string: str) -> str: ...
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> List[str]: ...
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ...
def body_encode(self, string: str) -> str: ...
def __str__(self) -> str: ...
def __eq__(self, other: Any) -> bool: ...

View File

@@ -1,5 +1,5 @@
from email.charset import Charset
from typing import Any, List, Tuple
from typing import Any, Tuple
class Header:
def __init__(
@@ -17,9 +17,9 @@ class Header:
def __eq__(self, other: Any) -> bool: ...
def __ne__(self, other: Any) -> bool: ...
def decode_header(header: Header | str) -> List[Tuple[bytes, str | None]]: ...
def decode_header(header: Header | str) -> list[Tuple[bytes, str | None]]: ...
def make_header(
decoded_seq: List[Tuple[bytes, str | None]],
decoded_seq: list[Tuple[bytes, str | None]],
maxlinelen: int | None = ...,
header_name: str | None = ...,
continuation_ws: str = ...,

View File

@@ -11,7 +11,7 @@ from email._header_value_parser import (
)
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, Dict, Iterable, Mapping, Tuple, Type
from typing import Any, Iterable, Mapping, Tuple, Type
class BaseHeader(str):
@property
@@ -28,7 +28,7 @@ class UnstructuredHeader:
@staticmethod
def value_parser(value: str) -> UnstructuredTokenList: ...
@classmethod
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class UniqueUnstructuredHeader(UnstructuredHeader): ...
@@ -38,7 +38,7 @@ class DateHeader:
@staticmethod
def value_parser(value: str) -> UnstructuredTokenList: ...
@classmethod
def parse(cls, value: str | _datetime, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str | _datetime, kwds: dict[str, Any]) -> None: ...
class UniqueDateHeader(DateHeader): ...
@@ -50,7 +50,7 @@ class AddressHeader:
@staticmethod
def value_parser(value: str) -> AddressList: ...
@classmethod
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class UniqueAddressHeader(AddressHeader): ...
@@ -70,13 +70,13 @@ class MIMEVersionHeader:
@staticmethod
def value_parser(value: str) -> MIMEVersion: ...
@classmethod
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class ParameterizedMIMEHeader:
@property
def params(self) -> Mapping[str, Any]: ...
@classmethod
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
class ContentTypeHeader(ParameterizedMIMEHeader):
@property
@@ -98,7 +98,7 @@ class ContentTransferEncodingHeader:
@property
def cte(self) -> str: ...
@classmethod
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
@staticmethod
def value_parser(value: str) -> ContentTransferEncoding: ...
@@ -106,7 +106,7 @@ if sys.version_info >= (3, 8):
from email._header_value_parser import MessageID
class MessageIDHeader:
@classmethod
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
@staticmethod
def value_parser(value: str) -> MessageID: ...

View File

@@ -16,7 +16,7 @@ class Message:
policy: Policy # undocumented
preamble: str | None
epilogue: str | None
defects: List[MessageDefect]
defects: list[MessageDefect]
def __str__(self) -> str: ...
def is_multipart(self) -> bool: ...
def set_unixfrom(self, unixfrom: str) -> None: ...
@@ -31,11 +31,11 @@ class Message:
def __getitem__(self, name: str) -> _HeaderType: ...
def __setitem__(self, name: str, val: _HeaderType) -> None: ...
def __delitem__(self, name: str) -> None: ...
def keys(self) -> List[str]: ...
def values(self) -> List[_HeaderType]: ...
def items(self) -> List[Tuple[str, _HeaderType]]: ...
def keys(self) -> list[str]: ...
def values(self) -> list[_HeaderType]: ...
def items(self) -> list[Tuple[str, _HeaderType]]: ...
def get(self, name: str, failobj: _T = ...) -> _HeaderType | _T: ...
def get_all(self, name: str, failobj: _T = ...) -> List[_HeaderType] | _T: ...
def get_all(self, name: str, failobj: _T = ...) -> list[_HeaderType] | _T: ...
def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ...
def replace_header(self, _name: str, _value: _HeaderType) -> None: ...
def get_content_type(self) -> str: ...
@@ -43,7 +43,7 @@ class Message:
def get_content_subtype(self) -> str: ...
def get_default_type(self) -> str: ...
def set_default_type(self, ctype: str) -> None: ...
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> List[Tuple[str, str]] | _T: ...
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> list[Tuple[str, str]] | _T: ...
def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> _T | _ParamType: ...
def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ...
def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ...
@@ -51,7 +51,7 @@ class Message:
def get_boundary(self, failobj: _T = ...) -> _T | str: ...
def set_boundary(self, boundary: str) -> None: ...
def get_content_charset(self, failobj: _T = ...) -> _T | str: ...
def get_charsets(self, failobj: _T = ...) -> _T | List[str]: ...
def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ...
def walk(self) -> Generator[Message, None, None]: ...
def get_content_disposition(self) -> str | None: ...
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., policy: Policy | None = ...) -> str: ...

View File

@@ -3,7 +3,7 @@ from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.header import Header
from email.message import Message
from typing import Any, Callable, List, Tuple
from typing import Any, Callable, Tuple
class Policy:
max_line_length: int | None
@@ -17,7 +17,7 @@ class Policy:
def register_defect(self, obj: Message, defect: MessageDefect) -> None: ...
def header_max_count(self, name: str) -> int | None: ...
@abstractmethod
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
@abstractmethod
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
@abstractmethod
@@ -28,7 +28,7 @@ class Policy:
def fold_binary(self, name: str, value: str) -> bytes: ...
class Compat32(Policy):
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
def header_fetch_parse(self, name: str, value: str) -> str | Header: ... # type: ignore
def fold(self, name: str, value: str) -> str: ...
@@ -41,7 +41,7 @@ class EmailPolicy(Policy):
refold_source: str
header_factory: Callable[[str, str], str]
content_manager: ContentManager
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
def header_fetch_parse(self, name: str, value: str) -> str: ...
def fold(self, name: str, value: str) -> str: ...

View File

@@ -1,7 +1,7 @@
import datetime
import sys
from email.charset import Charset
from typing import List, Optional, Tuple, Union, overload
from typing import Optional, Tuple, Union, overload
_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]]
_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]]
@@ -10,7 +10,7 @@ def quote(str: str) -> str: ...
def unquote(str: str) -> str: ...
def parseaddr(addr: str | None) -> Tuple[str, str]: ...
def formataddr(pair: Tuple[str | None, str], charset: str | Charset = ...) -> str: ...
def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ...
def getaddresses(fieldvalues: list[str]) -> list[Tuple[str, str]]: ...
@overload
def parsedate(data: None) -> None: ...
@overload
@@ -37,4 +37,4 @@ def make_msgid(idstring: str | None = ..., domain: str | None = ...) -> str: ...
def decode_rfc2231(s: str) -> Tuple[str | None, str | None, str]: ...
def encode_rfc2231(s: str, charset: str | None = ..., language: str | None = ...) -> str: ...
def collapse_rfc2231_value(value: _ParamType, errors: str = ..., fallback_charset: str = ...) -> str: ...
def decode_params(params: List[Tuple[str, str]]) -> List[Tuple[str, _ParamType]]: ...
def decode_params(params: list[Tuple[str, str]]) -> list[Tuple[str, _ParamType]]: ...

View File

@@ -1,7 +1,7 @@
import sys
from abc import ABCMeta
from builtins import property as _builtins_property
from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar
from typing import Any, Iterator, Mapping, Type, TypeVar
_T = TypeVar("_T")
_S = TypeVar("_S", bound=Type[Enum])
@@ -25,21 +25,21 @@ class Enum(metaclass=EnumMeta):
value: Any
_name_: str
_value_: Any
_member_names_: List[str] # undocumented
_member_map_: Dict[str, Enum] # undocumented
_value2member_map_: Dict[int, Enum] # undocumented
_member_names_: list[str] # undocumented
_member_map_: dict[str, Enum] # undocumented
_value2member_map_: dict[int, Enum] # undocumented
if sys.version_info >= (3, 7):
_ignore_: str | List[str]
_ignore_: str | list[str]
_order_: str
__order__: str
@classmethod
def _missing_(cls, value: object) -> Any: ...
@staticmethod
def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ...
def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> Any: ...
def __new__(cls: Type[_T], value: object) -> _T: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __dir__(self) -> List[str]: ...
def __dir__(self) -> list[str]: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> Any: ...
def __reduce_ex__(self, proto: object) -> Any: ...

View File

@@ -1,17 +1,17 @@
import sys
from _typeshed import StrOrBytesPath
from os import PathLike
from typing import Any, AnyStr, Callable, Dict, Generic, Iterable, List, Sequence, Tuple
from typing import Any, AnyStr, Callable, Generic, Iterable, Sequence, Tuple
if sys.version_info >= (3, 9):
from types import GenericAlias
DEFAULT_IGNORES: List[str]
DEFAULT_IGNORES: list[str]
def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: int | bool = ...) -> bool: ...
def cmpfiles(
a: AnyStr | PathLike[AnyStr], b: AnyStr | PathLike[AnyStr], common: Iterable[AnyStr], shallow: int | bool = ...
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
) -> Tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ...
class dircmp(Generic[AnyStr]):
def __init__(
@@ -26,22 +26,22 @@ class dircmp(Generic[AnyStr]):
hide: Sequence[AnyStr]
ignore: Sequence[AnyStr]
# These properties are created at runtime by __getattr__
subdirs: Dict[AnyStr, dircmp[AnyStr]]
same_files: List[AnyStr]
diff_files: List[AnyStr]
funny_files: List[AnyStr]
common_dirs: List[AnyStr]
common_files: List[AnyStr]
common_funny: List[AnyStr]
common: List[AnyStr]
left_only: List[AnyStr]
right_only: List[AnyStr]
left_list: List[AnyStr]
right_list: List[AnyStr]
subdirs: dict[AnyStr, dircmp[AnyStr]]
same_files: list[AnyStr]
diff_files: list[AnyStr]
funny_files: list[AnyStr]
common_dirs: list[AnyStr]
common_files: list[AnyStr]
common_funny: list[AnyStr]
common: list[AnyStr]
left_only: list[AnyStr]
right_only: list[AnyStr]
left_list: list[AnyStr]
right_list: list[AnyStr]
def report(self) -> None: ...
def report_partial_closure(self) -> None: ...
def report_full_closure(self) -> None: ...
methodmap: Dict[str, Callable[[], None]]
methodmap: dict[str, Callable[[], None]]
def phase0(self) -> None: ...
def phase1(self) -> None: ...
def phase2(self) -> None: ...

View File

@@ -1,6 +1,6 @@
from typing import AnyStr, Iterable, List
from typing import AnyStr, Iterable
def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ...
def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ...
def filter(names: Iterable[AnyStr], pat: AnyStr) -> List[AnyStr]: ...
def filter(names: Iterable[AnyStr], pat: AnyStr) -> list[AnyStr]: ...
def translate(pat: str) -> str: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Iterable, List, Tuple
from typing import IO, Any, Iterable, Tuple
AS_IS: None
_FontType = Tuple[str, bool, bool, bool]
@@ -28,9 +28,9 @@ class NullFormatter:
class AbstractFormatter:
writer: NullWriter
align: str | None
align_stack: List[str | None]
font_stack: List[_FontType]
margin_stack: List[int]
align_stack: list[str | None]
font_stack: list[_FontType]
margin_stack: list[int]
spacing: str | None
style_stack: Any
nospace: int

View File

@@ -2,7 +2,7 @@ from _typeshed import Self, SupportsRead, SupportsReadline
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, Callable, Dict, Iterable, Iterator, List, TextIO, Tuple, Type
from typing import Any, Callable, Iterable, Iterator, TextIO, Tuple, Type
from typing_extensions import Literal
MSG_OOB: int
@@ -85,10 +85,10 @@ class FTP:
def retrlines(self, cmd: str, callback: Callable[[str], Any] | None = ...) -> str: ...
def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], Any] | None = ...) -> str: ...
def acct(self, password: str) -> str: ...
def nlst(self, *args: str) -> List[str]: ...
def nlst(self, *args: str) -> list[str]: ...
# Technically only the last arg can be a Callable but ...
def dir(self, *args: str | Callable[[str], None]) -> None: ...
def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, Dict[str, str]]]: ...
def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, dict[str, str]]]: ...
def rename(self, fromname: str, toname: str) -> str: ...
def delete(self, filename: str) -> str: ...
def cwd(self, dirname: str) -> str: ...

View File

@@ -3,7 +3,6 @@ from _typeshed import SupportsItems, SupportsLessThan
from typing import (
Any,
Callable,
Dict,
Generic,
Hashable,
Iterable,
@@ -63,7 +62,7 @@ def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsLessTha
class partial(Generic[_T]):
func: Callable[..., _T]
args: Tuple[Any, ...]
keywords: Dict[str, Any]
keywords: dict[str, Any]
def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
if sys.version_info >= (3, 9):
@@ -75,7 +74,7 @@ _Descriptor = Any
class partialmethod(Generic[_T]):
func: Callable[..., _T] | _Descriptor
args: Tuple[Any, ...]
keywords: Dict[str, Any]
keywords: dict[str, Any]
@overload
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
@overload

View File

@@ -1,13 +1,13 @@
import sys
from typing import Any, Dict, List, Tuple
from typing import Any, Tuple
DEBUG_COLLECTABLE: int
DEBUG_LEAK: int
DEBUG_SAVEALL: int
DEBUG_STATS: int
DEBUG_UNCOLLECTABLE: int
callbacks: List[Any]
garbage: List[Any]
callbacks: list[Any]
garbage: list[Any]
def collect(generation: int = ...) -> int: ...
def disable() -> None: ...
@@ -16,19 +16,19 @@ def get_count() -> Tuple[int, int, int]: ...
def get_debug() -> int: ...
if sys.version_info >= (3, 8):
def get_objects(generation: int | None = ...) -> List[Any]: ...
def get_objects(generation: int | None = ...) -> list[Any]: ...
else:
def get_objects() -> List[Any]: ...
def get_objects() -> list[Any]: ...
if sys.version_info >= (3, 7):
def freeze() -> None: ...
def unfreeze() -> None: ...
def get_freeze_count() -> int: ...
def get_referents(*objs: Any) -> List[Any]: ...
def get_referrers(*objs: Any) -> List[Any]: ...
def get_stats() -> List[Dict[str, Any]]: ...
def get_referents(*objs: Any) -> list[Any]: ...
def get_referrers(*objs: Any) -> list[Any]: ...
def get_stats() -> list[dict[str, Any]]: ...
def get_threshold() -> Tuple[int, int, int]: ...
def is_tracked(__obj: Any) -> bool: ...

View File

@@ -1,17 +1,17 @@
import os
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsLessThanT
from typing import List, Sequence, Tuple, overload
from typing import Sequence, Tuple, overload
from typing_extensions import Literal
# All overloads can return empty string. Ideally, Literal[""] would be a valid
# Iterable[T], so that List[T] | Literal[""] could be used as a return
# Iterable[T], so that list[T] | Literal[""] could be used as a return
# type. But because this only works when T is str, we need Sequence[T] instead.
@overload
def commonprefix(m: Sequence[StrPath]) -> str: ...
@overload
def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ...
@overload
def commonprefix(m: Sequence[List[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
@overload
def commonprefix(m: Sequence[Tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ...
def exists(path: StrOrBytesPath) -> bool: ...

View File

@@ -1,20 +1,20 @@
import sys
from _typeshed import StrOrBytesPath
from typing import AnyStr, Iterator, List
from typing import AnyStr, Iterator
def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ...
def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ...
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
if sys.version_info >= (3, 10):
def glob(
pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ...
) -> List[AnyStr]: ...
) -> list[AnyStr]: ...
def iglob(
pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ...
) -> Iterator[AnyStr]: ...
else:
def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ...
def glob(pathname: AnyStr, *, recursive: bool = ...) -> list[AnyStr]: ...
def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ...
def escape(pathname: AnyStr) -> AnyStr: ...

View File

@@ -1,11 +1,11 @@
from typing import List, NamedTuple
from typing import NamedTuple
class struct_group(NamedTuple):
gr_name: str
gr_passwd: str | None
gr_gid: int
gr_mem: List[str]
gr_mem: list[str]
def getgrall() -> List[struct_group]: ...
def getgrall() -> list[struct_group]: ...
def getgrgid(id: int) -> struct_group: ...
def getgrnam(name: str) -> struct_group: ...

View File

@@ -1,14 +1,14 @@
from _typeshed import SupportsLessThan
from typing import Any, Callable, Iterable, List, TypeVar
from typing import Any, Callable, Iterable, TypeVar
_T = TypeVar("_T")
def heappush(__heap: List[_T], __item: _T) -> None: ...
def heappop(__heap: List[_T]) -> _T: ...
def heappushpop(__heap: List[_T], __item: _T) -> _T: ...
def heapify(__heap: List[Any]) -> None: ...
def heapreplace(__heap: List[_T], __item: _T) -> _T: ...
def heappush(__heap: list[_T], __item: _T) -> None: ...
def heappop(__heap: list[_T]) -> _T: ...
def heappushpop(__heap: list[_T], __item: _T) -> _T: ...
def heapify(__heap: list[Any]) -> None: ...
def heapreplace(__heap: list[_T], __item: _T) -> _T: ...
def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] | None = ..., reverse: bool = ...) -> Iterable[_T]: ...
def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> List[_T]: ...
def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> List[_T]: ...
def _heapify_max(__x: List[Any]) -> None: ... # undocumented
def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ...
def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ...
def _heapify_max(__x: list[Any]) -> None: ... # undocumented

View File

@@ -1,6 +1,4 @@
from typing import Dict
name2codepoint: Dict[str, int]
html5: Dict[str, str]
codepoint2name: Dict[int, str]
entitydefs: Dict[str, str]
name2codepoint: dict[str, int]
html5: dict[str, str]
codepoint2name: dict[int, str]
entitydefs: dict[str, str]

View File

@@ -1,5 +1,5 @@
from _markupbase import ParserBase
from typing import List, Tuple
from typing import Tuple
class HTMLParser(ParserBase):
def __init__(self, *, convert_charrefs: bool = ...) -> None: ...
@@ -8,9 +8,9 @@ class HTMLParser(ParserBase):
def reset(self) -> None: ...
def getpos(self) -> Tuple[int, int]: ...
def get_starttag_text(self) -> str | None: ...
def handle_starttag(self, tag: str, attrs: List[Tuple[str, str | None]]) -> None: ...
def handle_starttag(self, tag: str, attrs: list[Tuple[str, str | None]]) -> None: ...
def handle_endtag(self, tag: str) -> None: ...
def handle_startendtag(self, tag: str, attrs: List[Tuple[str, str | None]]) -> None: ...
def handle_startendtag(self, tag: str, attrs: list[Tuple[str, str | None]]) -> None: ...
def handle_data(self, data: str) -> None: ...
def handle_entityref(self, name: str) -> None: ...
def handle_charref(self, name: str) -> None: ...

View File

@@ -5,23 +5,7 @@ import sys
import types
from _typeshed import Self, WriteableBuffer
from socket import socket
from typing import (
IO,
Any,
BinaryIO,
Callable,
Dict,
Iterable,
Iterator,
List,
Mapping,
Protocol,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, Tuple, Type, TypeVar, Union, overload
_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
_T = TypeVar("_T")
@@ -87,7 +71,7 @@ INSUFFICIENT_STORAGE: int
NOT_EXTENDED: int
NETWORK_AUTHENTICATION_REQUIRED: int
responses: Dict[int, str]
responses: dict[int, str]
class HTTPMessage(email.message.Message):
def getallmatchingheaders(self, name: str) -> list[str]: ... # undocumented
@@ -112,7 +96,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
def getheader(self, name: str) -> str | None: ...
@overload
def getheader(self, name: str, default: _T) -> str | _T: ...
def getheaders(self) -> List[Tuple[str, str]]: ...
def getheaders(self) -> list[Tuple[str, str]]: ...
def fileno(self) -> int: ...
def isclosed(self) -> bool: ...
def __iter__(self) -> Iterator[bytes]: ...

View File

@@ -1,7 +1,7 @@
import sys
from _typeshed import StrPath
from http.client import HTTPResponse
from typing import ClassVar, Dict, Iterable, Iterator, Pattern, Sequence, Tuple, TypeVar, overload
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, Tuple, TypeVar, overload
from urllib.request import Request
_T = TypeVar("_T")
@@ -155,7 +155,7 @@ class Cookie:
discard: bool,
comment: str | None,
comment_url: str | None,
rest: Dict[str, str],
rest: dict[str, str],
rfc2109: bool = ...,
) -> None: ...
def has_nonstandard_attr(self, name: str) -> bool: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, Generic, Iterable, List, Mapping, Tuple, TypeVar, Union, overload
from typing import Any, Dict, Generic, Iterable, Mapping, Tuple, TypeVar, Union, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -34,9 +34,9 @@ class Morsel(Dict[str, Any], Generic[_T]):
@overload
def update(self, values: Iterable[Tuple[str, str]]) -> None: ...
def isReservedKey(self, K: str) -> bool: ...
def output(self, attrs: List[str] | None = ..., header: str = ...) -> str: ...
def js_output(self, attrs: List[str] | None = ...) -> str: ...
def OutputString(self, attrs: List[str] | None = ...) -> str: ...
def output(self, attrs: list[str] | None = ..., header: str = ...) -> str: ...
def js_output(self, attrs: list[str] | None = ...) -> str: ...
def OutputString(self, attrs: list[str] | None = ...) -> str: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -44,8 +44,8 @@ class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
def __init__(self, input: _DataType | None = ...) -> None: ...
def value_decode(self, val: str) -> _T: ...
def value_encode(self, val: _T) -> str: ...
def output(self, attrs: List[str] | None = ..., header: str = ..., sep: str = ...) -> str: ...
def js_output(self, attrs: List[str] | None = ...) -> str: ...
def output(self, attrs: list[str] | None = ..., header: str = ..., sep: str = ...) -> str: ...
def js_output(self, attrs: list[str] | None = ...) -> str: ...
def load(self, rawdata: _DataType) -> None: ...
def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ...

View File

@@ -3,7 +3,7 @@ import io
import socketserver
import sys
from _typeshed import StrPath, SupportsRead, SupportsWrite
from typing import Any, AnyStr, BinaryIO, ClassVar, Dict, List, Mapping, Sequence, Tuple
from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence, Tuple
class HTTPServer(socketserver.TCPServer):
server_name: str
@@ -53,7 +53,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
server_version: str
extensions_map: Dict[str, str]
extensions_map: dict[str, str]
if sys.version_info >= (3, 7):
def __init__(
self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
@@ -71,7 +71,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def executable(path: StrPath) -> bool: ... # undocumented
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: List[str]
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented

View File

@@ -1,5 +1,5 @@
from _typeshed import StrPath
from typing import Any, BinaryIO, Callable, List, Protocol, overload
from typing import Any, BinaryIO, Callable, Protocol, overload
class _ReadableBinary(Protocol):
def tell(self) -> int: ...
@@ -11,4 +11,4 @@ def what(file: StrPath | _ReadableBinary, h: None = ...) -> str | None: ...
@overload
def what(file: Any, h: bytes) -> str | None: ...
tests: List[Callable[[bytes, BinaryIO | None], str | None]]
tests: list[Callable[[bytes, BinaryIO | None], str | None]]

View File

@@ -1,7 +1,7 @@
import types
from _typeshed import StrPath
from os import PathLike
from typing import IO, Any, List, Protocol, Tuple, TypeVar
from typing import IO, Any, Protocol, Tuple, TypeVar
from _imp import (
acquire_lock as acquire_lock,
@@ -33,7 +33,7 @@ def get_magic() -> bytes: ...
def get_tag() -> str: ...
def cache_from_source(path: StrPath, debug_override: bool | None = ...) -> str: ...
def source_from_cache(path: StrPath) -> str: ...
def get_suffixes() -> List[Tuple[str, str, int]]: ...
def get_suffixes() -> list[Tuple[str, str, int]]: ...
class NullImporter:
def __init__(self, path: StrPath) -> None: ...
@@ -57,7 +57,7 @@ def load_module(name: str, file: _FileLike | None, filename: str, details: Tuple
# IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise.
def find_module(
name: str, path: None | List[str] | List[PathLike[str]] | List[StrPath] = ...
name: str, path: None | list[str] | list[PathLike[str]] | list[StrPath] = ...
) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ...
def reload(module: types.ModuleType) -> types.ModuleType: ...
def init_builtin(name: str) -> types.ModuleType | None: ...

View File

@@ -1,6 +1,6 @@
import importlib.abc
import types
from typing import Any, Callable, List, Sequence, Tuple
from typing import Any, Callable, Sequence, Tuple
# TODO: the loaders seem a bit backwards, attribute is protocol but __init__ arg isn't?
class ModuleSpec:
@@ -16,7 +16,7 @@ class ModuleSpec:
name: str
loader: importlib.abc._LoaderProtocol | None
origin: str | None
submodule_search_locations: List[str] | None
submodule_search_locations: list[str] | None
loader_state: Any
cached: str | None
parent: str | None
@@ -90,20 +90,20 @@ class PathFinder:
@classmethod
def find_module(cls, fullname: str, path: Sequence[bytes | str] | None = ...) -> importlib.abc.Loader | None: ...
SOURCE_SUFFIXES: List[str]
DEBUG_BYTECODE_SUFFIXES: List[str]
OPTIMIZED_BYTECODE_SUFFIXES: List[str]
BYTECODE_SUFFIXES: List[str]
EXTENSION_SUFFIXES: List[str]
SOURCE_SUFFIXES: list[str]
DEBUG_BYTECODE_SUFFIXES: list[str]
OPTIMIZED_BYTECODE_SUFFIXES: list[str]
BYTECODE_SUFFIXES: list[str]
EXTENSION_SUFFIXES: list[str]
def all_suffixes() -> List[str]: ...
def all_suffixes() -> list[str]: ...
class FileFinder(importlib.abc.PathEntryFinder):
path: str
def __init__(self, path: str, *loader_details: Tuple[importlib.abc.Loader, List[str]]) -> None: ...
def __init__(self, path: str, *loader_details: Tuple[importlib.abc.Loader, list[str]]) -> None: ...
@classmethod
def path_hook(
cls, *loader_details: Tuple[importlib.abc.Loader, List[str]]
cls, *loader_details: Tuple[importlib.abc.Loader, list[str]]
) -> Callable[[str], importlib.abc.PathEntryFinder]: ...
class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader):

View File

@@ -7,10 +7,10 @@ from email.message import Message
from importlib.abc import MetaPathFinder
from os import PathLike
from pathlib import Path
from typing import Any, Dict, Iterable, List, NamedTuple, Tuple, overload
from typing import Any, Iterable, NamedTuple, Tuple, overload
if sys.version_info >= (3, 10):
def packages_distributions() -> Mapping[str, List[str]]: ...
def packages_distributions() -> Mapping[str, list[str]]: ...
if sys.version_info >= (3, 8):
class PackageNotFoundError(ModuleNotFoundError): ...
@@ -21,7 +21,7 @@ if sys.version_info >= (3, 8):
class EntryPoint(_EntryPointBase):
def load(self) -> Any: ... # Callable[[], Any] or an importable module
@property
def extras(self) -> List[str]: ...
def extras(self) -> list[str]: ...
class PackagePath(pathlib.PurePosixPath):
def read_text(self, encoding: str = ...) -> str: ...
def read_binary(self) -> bytes: ...
@@ -47,7 +47,7 @@ if sys.version_info >= (3, 8):
@overload
@classmethod
def discover(
cls, *, context: None = ..., name: str | None = ..., path: List[str] = ..., **kwargs: Any
cls, *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any
) -> Iterable[Distribution]: ...
@staticmethod
def at(path: StrPath) -> PathDistribution: ...
@@ -56,17 +56,17 @@ if sys.version_info >= (3, 8):
@property
def version(self) -> str: ...
@property
def entry_points(self) -> List[EntryPoint]: ...
def entry_points(self) -> list[EntryPoint]: ...
@property
def files(self) -> List[PackagePath] | None: ...
def files(self) -> list[PackagePath] | None: ...
@property
def requires(self) -> List[str] | None: ...
def requires(self) -> list[str] | None: ...
class DistributionFinder(MetaPathFinder):
class Context:
name: str | None
def __init__(self, *, name: str | None = ..., path: List[str] = ..., **kwargs: Any) -> None: ...
def __init__(self, *, name: str | None = ..., path: list[str] = ..., **kwargs: Any) -> None: ...
@property
def path(self) -> List[str]: ...
def path(self) -> list[str]: ...
@abc.abstractmethod
def find_distributions(self, context: DistributionFinder.Context = ...) -> Iterable[Distribution]: ...
class MetadataPathFinder(DistributionFinder):
@@ -81,10 +81,10 @@ if sys.version_info >= (3, 8):
def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ...
@overload
def distributions(
*, context: None = ..., name: str | None = ..., path: List[str] = ..., **kwargs: Any
*, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any
) -> Iterable[Distribution]: ...
def metadata(distribution_name: str) -> Message: ...
def version(distribution_name: str) -> str: ...
def entry_points() -> Dict[str, Tuple[EntryPoint, ...]]: ...
def files(distribution_name: str) -> List[PackagePath] | None: ...
def requires(distribution_name: str) -> List[str] | None: ...
def entry_points() -> dict[str, Tuple[EntryPoint, ...]]: ...
def files(distribution_name: str) -> list[PackagePath] | None: ...
def requires(distribution_name: str) -> list[str] | None: ...

View File

@@ -2,7 +2,7 @@ import importlib.abc
import importlib.machinery
import types
from _typeshed import StrOrBytesPath
from typing import Any, Callable, List
from typing import Any, Callable
def module_for_loader(fxn: Callable[..., types.ModuleType]) -> Callable[..., types.ModuleType]: ...
def set_loader(fxn: Callable[..., types.ModuleType]) -> Callable[..., types.ModuleType]: ...
@@ -23,7 +23,7 @@ def spec_from_file_location(
location: StrOrBytesPath | None = ...,
*,
loader: importlib.abc.Loader | None = ...,
submodule_search_locations: List[str] | None = ...,
submodule_search_locations: list[str] | None = ...,
) -> importlib.machinery.ModuleSpec | None: ...
def module_from_spec(spec: importlib.machinery.ModuleSpec) -> types.ModuleType: ...

Some files were not shown because too many files have changed in this diff Show More