10000 [tty] py312: Fix return types of set(raw|cbreak) by srittau · Pull Request #10785 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

[tty] py312: Fix return types of set(raw|cbreak) #10785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change type alias name
  • Loading branch information
srittau committed Sep 27, 2023
commit 73e788687cc9ca08613c5d0ce7c91f863f5bfef0
9 changes: 5 additions & 4 deletions stdlib/tty.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ if sys.platform != "win32":
__all__ = ["setraw", "setcbreak"]
if sys.version_info >= (3, 12):
__all__ += ["cfmakeraw", "cfmakecbreak"]
_SetReturn: TypeAlias = _AttrReturn

_ModeSetterReturn: TypeAlias = _AttrReturn
else:
_SetReturn: TypeAlias = None
_ModeSetterReturn: TypeAlias = None

_FD: TypeAlias = int | IO[str]

Expand All @@ -21,8 +22,8 @@ if sys.platform != "win32":
ISPEED: int
OSPEED: int
CC: int
def setraw(fd: _FD, when: int = 2) -> _SetReturn: ...
def setcbreak(fd: _FD, when: int = 2) -> _SetReturn: ...
def setraw(fd: _FD, when: int = 2) -> _ModeSetterReturn: ...
def setcbreak(fd: _FD, when: int = 2) -> _ModeSetterReturn: ...

if sys.version_info >= (3, 12):
# It is: `list[int, int, int, int, int, int, list[str]]
Expand Down
0