From f2633c3201ba14ded0cc3b65997edb2c81194a43 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 8 Jan 2023 04:13:54 -0500 Subject: [PATCH 1/2] Add FileDescriptorOrPath and Unused type aliases --- stdlib/_typeshed/__init__.pyi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index f01db74caf40..7323b633310f 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -36,6 +36,9 @@ AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001 # "Incomplete | None" instead of "Any | None". Incomplete: TypeAlias = Any +# To describe a method parameter that is unused and will work with anything. +Unused: TypeAlias = object + # stable class IdentityFunction(Protocol): def __call__(self, __x: _T) -> _T: ... @@ -205,6 +208,7 @@ class HasFileno(Protocol): FileDescriptor: TypeAlias = int # stable FileDescriptorLike: TypeAlias = int | HasFileno # stable +FileDescriptorOrPath: TypeAlias = int | StrOrBytesPath # stable class SupportsRead(Protocol[_T_co]): From b042eba75e944b03914cc66e1b03651739174420 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 8 Jan 2023 09:47:45 +0000 Subject: [PATCH 2/2] Update stdlib/_typeshed/__init__.pyi --- stdlib/_typeshed/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 7323b633310f..68ac2a9b1900 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -36,7 +36,7 @@ AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001 # "Incomplete | None" instead of "Any | None". Incomplete: TypeAlias = Any -# To describe a method parameter that is unused and will work with anything. +# To describe a function parameter that is unused and will work with anything. Unused: TypeAlias = object # stable