Backport many Self-related changes to the Python-2 stdlib (#7128)

This commit is contained in:
Alex Waygood
2022-02-04 18:10:05 +00:00
committed by GitHub
parent 57b2bae031
commit 51cdd2c6be
19 changed files with 37 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import collections
from _typeshed import Self
from typing import Any, Iterator
class Shelf(collections.MutableMapping[Any, Any]):
@@ -14,7 +15,7 @@ class Shelf(collections.MutableMapping[Any, Any]):
def __getitem__(self, key: Any) -> Any: ...
def __setitem__(self, key: Any, value: Any) -> None: ...
def __delitem__(self, key: Any) -> None: ...
def __enter__(self) -> Shelf: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
def close(self) -> None: ...
def __del__(self) -> None: ...