From 38a1c344c9cb20e37656ab468d683a7eed579705 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 20 Feb 2021 18:44:36 -0800 Subject: [PATCH] Small fixes for Python 3.10 (#5044) This is enough to get stubtest working (note that it's a little annoying to install mypy currently since typed-ast seems to have broken again on Python 3.10) Co-authored-by: hauntsaninja <> --- stdlib/shelve.pyi | 4 ++-- stdlib/types.pyi | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/shelve.pyi b/stdlib/shelve.pyi index bbbd72e44b24..ed062f62b49b 100644 --- a/stdlib/shelve.pyi +++ b/stdlib/shelve.pyi @@ -1,7 +1,7 @@ -import collections +import collections.abc from typing import Any, Dict, Iterator, Optional, Tuple -class Shelf(collections.MutableMapping[Any, Any]): +class Shelf(collections.abc.MutableMapping[Any, Any]): def __init__( self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ... ) -> None: ... diff --git a/stdlib/types.pyi b/stdlib/types.pyi index d5b419c177ed..22ec7e5aae63 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -331,4 +331,6 @@ if sys.version_info >= (3, 10): class NoneType: def __bool__(self) -> Literal[False]: ... EllipsisType = ellipsis # noqa F811 from builtins + from builtins import _NotImplementedType + NotImplementedType = _NotImplementedType # noqa F811 from builtins