Skip to content

Commit ad59af1

Browse files
test union return types
1 parent fd750bf commit ad59af1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

stdlib/builtins.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ from collections.abc import Callable
2626
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
2727
from types import CodeType, TracebackType, _Cell
2828
from typing import (
29-
IO,
3029
AbstractSet,
3130
Any,
3231
BinaryIO,
@@ -49,6 +48,7 @@ from typing import (
4948
SupportsFloat,
5049
SupportsInt,
5150
SupportsRound,
51+
TextIO,
5252
TypeVar,
5353
Union,
5454
overload,
@@ -1327,7 +1327,7 @@ def open(
13271327
newline: str | None = ...,
13281328
closefd: bool = ...,
13291329
opener: _Opener | None = ...,
1330-
) -> IO[Any]: ...
1330+
) -> BinaryIO | TextIO: ...
13311331
def ord(__c: str | bytes) -> int: ...
13321332

13331333
class _SupportsWriteAndFlush(SupportsWrite[_T_contra], Protocol[_T_contra]):

stdlib/subprocess.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ if sys.version_info >= (3, 7):
633633
encoding: str | None = ...,
634634
errors: str | None = ...,
635635
text: bool | None = ...,
636-
) -> Any: ... # morally: -> _TXT
636+
) -> _TXT: ... # morally: -> _TXT
637637

638638
else:
639639
@overload
@@ -755,7 +755,7 @@ else:
755755
input: _TXT | None = ...,
756756
encoding: str | None = ...,
757757
errors: str | None = ...,
758-
) -> Any: ... # morally: -> _TXT
758+
) -> _TXT: ... # morally: -> _TXT
759759

760760
PIPE: int
761761
STDOUT: int

0 commit comments

Comments
 (0)