Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,12 +1,12 @@
import collections
from typing import Any, Dict, Iterator, List, Tuple
from typing import Any, Iterator
class Shelf(collections.MutableMapping[Any, Any]):
def __init__(
self, dict: Dict[Any, Any], protocol: int | None = ..., writeback: bool = ..., keyencoding: str = ...
self, dict: dict[Any, Any], protocol: int | None = ..., writeback: bool = ..., keyencoding: str = ...
) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def keys(self) -> List[Any]: ...
def keys(self) -> list[Any]: ...
def __len__(self) -> int: ...
def has_key(self, key: Any) -> bool: ...
def __contains__(self, key: Any) -> bool: ...
@@ -22,13 +22,13 @@ class Shelf(collections.MutableMapping[Any, Any]):
class BsdDbShelf(Shelf):
def __init__(
self, dict: Dict[Any, Any], protocol: int | None = ..., writeback: bool = ..., keyencoding: str = ...
self, dict: dict[Any, Any], protocol: int | None = ..., writeback: bool = ..., keyencoding: str = ...
) -> None: ...
def set_location(self, key: Any) -> Tuple[str, Any]: ...
def next(self) -> Tuple[str, Any]: ...
def previous(self) -> Tuple[str, Any]: ...
def first(self) -> Tuple[str, Any]: ...
def last(self) -> Tuple[str, Any]: ...
def set_location(self, key: Any) -> tuple[str, Any]: ...
def next(self) -> tuple[str, Any]: ...
def previous(self) -> tuple[str, Any]: ...
def first(self) -> tuple[str, Any]: ...
def last(self) -> tuple[str, Any]: ...
class DbfilenameShelf(Shelf):
def __init__(self, filename: str, flag: str = ..., protocol: int | None = ..., writeback: bool = ...) -> None: ...