From 58147cab20b6ad0655924cb301b09cd98a4c768a Mon Sep 17 00:00:00 2001 From: Shantanu Date: Sat, 16 May 2020 16:47:14 -0700 Subject: [PATCH] aifc: fix mode default (#4019) By default, if not specified, these functions use the mode from the file Co-authored-by: hauntsaninja <> --- stdlib/2and3/aifc.pyi | 8 ++++---- tests/stubtest_whitelists/py3_common.txt | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/stdlib/2and3/aifc.pyi b/stdlib/2and3/aifc.pyi index c2fd608de..61e31a9ed 100644 --- a/stdlib/2and3/aifc.pyi +++ b/stdlib/2and3/aifc.pyi @@ -71,15 +71,15 @@ class Aifc_write: def close(self) -> None: ... @overload -def open(f: _File, mode: Literal["r", "rb"] = ...) -> Aifc_read: ... +def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload -def open(f: _File, mode: str) -> Any: ... +def open(f: _File, mode: Optional[str] = ...) -> Any: ... @overload -def openfp(f: _File, mode: Literal["r", "rb"] = ...) -> Aifc_read: ... +def openfp(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... @overload def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload -def openfp(f: _File, mode: str) -> Any: ... +def openfp(f: _File, mode: Optional[str] = ...) -> Any: ... diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 10365662c..a9ad30b2b 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -11,8 +11,6 @@ _weakref.ReferenceType.__call__ abc.abstractclassmethod abc.abstractmethod abc.abstractstaticmethod -aifc.open -aifc.openfp argparse.Namespace.__getattr__ asyncio.BaseEventLoop.subprocess_exec asyncio.Condition.acquire