Skip to content
Merged
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
14 changes: 7 additions & 7 deletions src/obspec/_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class GetOptions(TypedDict, total=False):
class GetResult(Iterable[Buffer], Protocol):
"""Result for a get request.

You can materialize the entire buffer by calling the `bytes` method or you can
You can materialize the entire buffer by calling the `buffer` method or you can
stream the result by iterating over it .

**Example:**
Expand All @@ -137,7 +137,7 @@ class GetResult(Iterable[Buffer], Protocol):
def streaming_download(client: Get, path: str):
resp = client.get(path)
for buffer in resp:
print(len(buffer))
print(len(memoryview(buffer)))
```
"""

Expand All @@ -146,7 +146,7 @@ def attributes(self) -> Attributes:
"""Additional object attributes."""
...

def bytes(self) -> Buffer:
def buffer(self) -> Buffer:
"""Collect the data into a `Buffer` object.

This implements the Python buffer protocol. You can copy the buffer to Python
Expand All @@ -171,8 +171,8 @@ def range(self) -> tuple[int, int]:
class GetResultAsync(AsyncIterable[Buffer], Protocol):
"""Result for an async get request.

You can materialize the entire buffer by calling the `bytes_async` method or you can
stream the result by asynchronously iterating over it.
You can materialize the entire buffer by calling the `buffer_async` method or you
can stream the result by asynchronously iterating over it.

**Example:**

Expand All @@ -182,7 +182,7 @@ class GetResultAsync(AsyncIterable[Buffer], Protocol):
async def streaming_download(obs: GetAsync, path: str):
resp = await client.get_async(path)
async for buffer in resp:
print(len(buffer))
print(len(memoryview(buffer)))
```
"""

Expand All @@ -191,7 +191,7 @@ def attributes(self) -> Attributes:
"""Additional object attributes."""
...

async def bytes_async(self) -> Buffer:
async def buffer_async(self) -> Buffer:
"""Collect the data into a `Buffer` object.

This implements the Python buffer protocol. You can copy the buffer to Python
Expand Down
Loading