Skip to content

Commit 41de531

Browse files
authored
Add FileDescriptorOrPath and Unused type aliases (#9475)
1 parent f115a3c commit 41de531

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/_typeshed/__init__.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001
3636
# "Incomplete | None" instead of "Any | None".
3737
Incomplete: TypeAlias = Any
3838

39+
# To describe a function parameter that is unused and will work with anything.
40+
Unused: TypeAlias = object
41+
3942
# stable
4043
class IdentityFunction(Protocol):
4144
def __call__(self, __x: _T) -> _T: ...
@@ -205,6 +208,7 @@ class HasFileno(Protocol):
205208

206209
FileDescriptor: TypeAlias = int # stable
207210
FileDescriptorLike: TypeAlias = int | HasFileno # stable
211+
FileDescriptorOrPath: TypeAlias = int | StrOrBytesPath
208212

209213
# stable
210214
class SupportsRead(Protocol[_T_co]):

0 commit comments

Comments
 (0)