Skip to content

Commit efafbe2

Browse files
Use _ to show that a return value is deliberately ignored
- This is a convention. - Ensures that all ignored return values are explicit, helping to avoid bugs.
1 parent d51b402 commit efafbe2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/pdfrest/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def _validate_pdfrest_api_key(api_key: str, url: URL) -> None:
598598
msg = "pdfRest API keys must be 36 characters (UUID format)."
599599
raise PdfRestConfigurationError(msg)
600600
try:
601-
uuid.UUID(api_key)
601+
_ = uuid.UUID(api_key)
602602
except ValueError:
603603
msg = "pdfRest API keys must be valid UUID strings."
604604
raise PdfRestConfigurationError(msg) from None
@@ -789,7 +789,7 @@ def _rewind_stream_snapshots(self, request: _RequestModel) -> bool:
789789
)
790790
return False
791791
try:
792-
seek_fn(position)
792+
_ = seek_fn(position)
793793
except (OSError, ValueError) as exc: # pragma: no cover - defensive
794794
request.mark_non_rewindable_streams()
795795
self._log_non_rewindable_stream(
@@ -1690,7 +1690,7 @@ def write_bytes(
16901690
try:
16911691
with path.open("wb") as file_handle:
16921692
for chunk in response.iter_bytes():
1693-
file_handle.write(chunk)
1693+
_ = file_handle.write(chunk)
16941694
finally:
16951695
response.close()
16961696
return path
@@ -1933,7 +1933,7 @@ async def write_bytes(
19331933
try:
19341934
with path.open("wb") as file_handle:
19351935
async for chunk in response.aiter_bytes():
1936-
file_handle.write(chunk)
1936+
_ = file_handle.write(chunk)
19371937
finally:
19381938
await response.aclose()
19391939
return path
@@ -1983,7 +1983,7 @@ def __init__(
19831983
self._files_client = _FilesClient(self)
19841984

19851985
def __enter__(self) -> PdfRestClient:
1986-
super().__enter__()
1986+
_ = super().__enter__()
19871987
return self
19881988

19891989
def __exit__(self, exc_type: Any, exc: Any, traceback: Any) -> None:
@@ -2412,7 +2412,7 @@ def __init__(
24122412
self._files_client = _AsyncFilesClient(self)
24132413

24142414
async def __aenter__(self) -> AsyncPdfRestClient:
2415-
await super().__aenter__()
2415+
_ = await super().__aenter__()
24162416
return self
24172417

24182418
async def __aexit__(self, exc_type: Any, exc: Any, traceback: Any) -> None:

src/pdfrest/models/_internal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def allowed_mime_types_validator(
144144
) -> PdfRestFile | list[PdfRestFile]:
145145
if isinstance(value, list):
146146
for item in value:
147-
allowed_mime_types_validator(item)
147+
_ = allowed_mime_types_validator(item)
148148
return value
149149
if value.type not in combined_allowed_mime_types:
150150
msg = error_msg or f"The file type must be one of: {allowed_mime_types}"

0 commit comments

Comments
 (0)