mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-14 23:32:22 +08:00
Cleanup: use lower-case list and dict, add a test (#6161)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
@@ -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 = ...,
|
||||
|
||||
Reference in New Issue
Block a user