8000 Add missing `tarfile.open` overload for writable objects by max-muoto · Pull Request #12117 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Add missing tarfile.open overload for writable objects #12117

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 2 commits into from
Jun 21, 2024
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
Revert
  • Loading branch information
max-muoto committed Jun 8, 2024
commit d33165b898fad10ce8216e4a9f4b25840d03bf48
7 changes: 1 addition & 6 deletions stdlib/tarfile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,12 @@ PAX_NAME_FIELDS: set[str]

ENCODING: str

_ReadModes: TypeAlias = Literal["r", "r:"]
_CompressionModes: TypeAlias = Literal[
"r:", "r:gz", "r:bz2", "r:xz", "w:", "w:gz", "w:bz2", "w:xz", "x:", "x:gz", "x:bz2", "x:xz"
]
_StreamModes: TypeAlias = Literal["r|*", "r|", "r|gz", "r|bz2", "r|xz", "w|", "w|gz", "w|bz2", "w|xz"]
_FileCreationModes: TypeAlias = Literal["a", "w", "x"]

@overload
def open(
name: StrOrBytesPath | None = None,
mode: _ReadModes | _CompressionModes | _StreamModes = "r",
mode: str = "r",
fileobj: IO[bytes] | None = None,
bufsize: int = 10240,
*,
Expand Down
0