diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 8a984022920d..a4b3c46a4178 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -10,7 +10,7 @@ _collections_abc.AsyncGenerator.ag_frame _collections_abc.AsyncGenerator.ag_running asyncio.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them -builtins.dict.get +# builtins.dict.get collections\.ChainMap\.fromkeys # https://github.com/python/mypy/issues/17023 configparser.SectionProxy.__getattr__ # SectionProxy can have arbitrary attributes when custom converters are used configparser.SectionProxy.getboolean # SectionProxy get functions are set in __init__ diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index ad10ba9dff4c..0438d8eb69f1 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1128,6 +1128,8 @@ class dict(MutableMapping[_KT, _VT]): @overload def get(self, key: _KT, default: _VT, /) -> _VT: ... @overload + def get(self, key: _KT, default: None, /) -> _VT | None: ... + @overload def get(self, key: _KT, default: _T, /) -> _VT | _T: ... @overload def pop(self, key: _KT, /) -> _VT: ... diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index 5e26f8987277..44c0bc4d91b7 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -141,6 +141,10 @@ if sys.version_info >= (3, 10) and sys.version_info < (3, 12): @overload def get(self, name: _KT) -> _VT | None: ... @overload + # def get(self, name: _KT, default: _VT) -> _VT: ... + # @overload + # def get(self, name: _KT, default: None) -> _VT | None: ... + # @overload def get(self, name: _KT, default: _T) -> _VT | _T: ... def __iter__(self) -> Iterator[_KT]: ... def __contains__(self, *args: object) -> bool: ...