Visitar URL original
gh-110383: Document `socket.makefile()` accepts combined modes by squeakyboots 路 Pull Request #119150 路 python/cpython 路 GitHub
Skip to content
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
Document socket.makefile() accepts combined modes in Lib/socket.py
  • Loading branch information
squeakyboots committed May 20, 2024
commit 20ded2e73b8f1dd7db81271bfd65f4f2930e27ec
3 changes: 2 additions & 1 deletion Lib/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ def makefile(self, mode="r", buffering=None, *,
"""makefile(...) -> an I/O stream connected to the socket

The arguments are as for io.open() after the filename, except the only
supported mode values are 'r' (default), 'w' and 'b'.
supported mode values are 'r' (default), 'w', 'b', or a combination of
those.
"""
# XXX refactor to share code?
if not set(mode) <= {"r", "w", "b"}:
Expand Down