Skip to content
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

binhex: improve bytes handling #9035

Merged
merged 7 commits into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions stdlib/_typeshed/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ else:
WriteableBuffer: TypeAlias = bytearray | memoryview | array.array[Any] | mmap.mmap | ctypes._CData # stable
# Same as _WriteableBuffer, but also includes read-only buffer types (like bytes).
ReadableBuffer: TypeAlias = ReadOnlyBuffer | WriteableBuffer # stable
_BufferWithLen: TypeAlias = ReadableBuffer # not stable # noqa: Y047

ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType]
OptExcInfo: TypeAlias = Union[ExcInfo, tuple[None, None, None]]
Expand Down
5 changes: 3 additions & 2 deletions stdlib/binhex.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import _BufferWithLen
from typing import IO, Any
from typing_extensions import Literal, TypeAlias

Expand Down Expand Up @@ -27,9 +28,9 @@ class openrsrc:

class BinHex:
def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ...
def write(self, data: bytes) -> None: ...
def write(self, data: _BufferWithLen) -> None: ...
def close_data(self) -> None: ...
def write_rsrc(self, data: bytes) -> None: ...
def write_rsrc(self, data: _BufferWithLen) -> None: ...
def close(self) -> None: ...

def binhex(inp: str, out: str) -> None: ...
Expand Down