Cleanup: use lower-case list and dict, add a test (#6161)

This commit is contained in:
Akuli
2021-10-13 19:59:27 +00:00
committed by GitHub
parent eab7adad62
commit e72a4034bf
8 changed files with 42 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import Self
from typing import Any, Callable, ContextManager, Dict, Generic, Iterable, Iterator, List, Mapping, TypeVar
from typing import Any, Callable, ContextManager, Generic, Iterable, Iterator, List, Mapping, TypeVar
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -17,7 +17,7 @@ class ApplyResult(Generic[_T]):
else:
def __init__(
self,
cache: Dict[int, ApplyResult[Any]],
cache: dict[int, ApplyResult[Any]],
callback: Callable[[_T], None] | None,
error_callback: Callable[[BaseException], None] | None,
) -> None: ...
@@ -44,7 +44,7 @@ class MapResult(ApplyResult[List[_T]]):
else:
def __init__(
self,
cache: Dict[int, ApplyResult[Any]],
cache: dict[int, ApplyResult[Any]],
chunksize: int,
length: int,
callback: Callable[[List[_T]], None] | None,
@@ -55,7 +55,7 @@ class IMapIterator(Iterator[_T]):
if sys.version_info >= (3, 8):
def __init__(self, pool: Pool) -> None: ...
else:
def __init__(self, cache: Dict[int, IMapIterator[Any]]) -> None: ...
def __init__(self, cache: dict[int, IMapIterator[Any]]) -> None: ...
def __iter__(self: _S) -> _S: ...
def next(self, timeout: float | None = ...) -> _T: ...
def __next__(self, timeout: float | None = ...) -> _T: ...

View File

@@ -1,7 +1,7 @@
import sys
from datetime import datetime
from enum import Enum
from typing import IO, Any, Dict as _Dict, List, Mapping, MutableMapping, Tuple, Type
from typing import IO, Any, Dict as _Dict, Mapping, MutableMapping, Tuple, Type
class PlistFormat(Enum):
FMT_XML: int
@@ -31,7 +31,7 @@ else:
) -> Any: ...
def dump(
value: Mapping[str, Any] | List[Any] | Tuple[Any, ...] | str | bool | float | bytes | datetime,
value: Mapping[str, Any] | list[Any] | Tuple[Any, ...] | str | bool | float | bytes | datetime,
fp: IO[bytes],
*,
fmt: PlistFormat = ...,
@@ -39,7 +39,7 @@ def dump(
skipkeys: bool = ...,
) -> None: ...
def dumps(
value: Mapping[str, Any] | List[Any] | Tuple[Any, ...] | str | bool | float | bytes | datetime,
value: Mapping[str, Any] | list[Any] | Tuple[Any, ...] | str | bool | float | bytes | datetime,
*,
fmt: PlistFormat = ...,
skipkeys: bool = ...,