Skip to content
Open
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
2 changes: 1 addition & 1 deletion examples/blob_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def main() -> None:

# 3b) Get object via get() (async client)
result = await client.get(uploaded.url, access="public")
print("get():", len(result.content), "bytes, etag:", result.etag)
print("get():", len(bytes(result)), "bytes, etag:", result.etag)

# 4) Copy (async client)
copied = await client.copy(
Expand Down
3 changes: 3 additions & 0 deletions src/vercel/blob/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class GetBlobResult:
content: bytes
status_code: int

def __bytes__(self) -> bytes:
return self.content
Comment on lines +71 to +72
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__bytes__ is a new public behavior on GetBlobResult, but there’s no unit test asserting bytes(result) returns the response content (and works for both 200 and 304 cases). Adding a small assertion in the existing _build_get_result tests would prevent regressions and validate the intended migration path.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples are run as tests, so this is covered.



@dataclass(slots=True)
class MultipartPart:
Expand Down