Skip to content

Commit 4ff9fa3

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 03a1ab1 commit 4ff9fa3

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
@@ -786,7 +786,7 @@ def _rewind_stream_snapshots(self, request: _RequestModel) -> bool:
786786
)
787787
return False
788788
try:
789-
seek_fn(position)
789+
_ = seek_fn(position)
790790
except (OSError, ValueError) as exc: # pragma: no cover - defensive
791791
request.mark_non_rewindable_streams()
792792
self._log_non_rewindable_stream(
@@ -1687,7 +1687,7 @@ def write_bytes(
16871687
try:
16881688
with path.open("wb") as file_handle:
16891689
for chunk in response.iter_bytes():
1690-
file_handle.write(chunk)
1690+
_ = file_handle.write(chunk)
16911691
finally:
16921692
response.close()
16931693
return path
@@ -1930,7 +1930,7 @@ async def write_bytes(
19301930
try:
19311931
with path.open("wb") as file_handle:
19321932
async for chunk in response.aiter_bytes():
1933-
file_handle.write(chunk)
1933+
_ = file_handle.write(chunk)
19341934
finally:
19351935
await response.aclose()
19361936
return path
@@ -1980,7 +1980,7 @@ def __init__(
19801980
self._files_client = _FilesClient(self)
19811981

19821982
def __enter__(self) -> PdfRestClient:
1983-
super().__enter__()
1983+
_ = super().__enter__()
19841984
return self
19851985

19861986
def __exit__(self, exc_type: Any, exc: Any, traceback: Any) -> None:
@@ -2409,7 +2409,7 @@ def __init__(
24092409
self._files_client = _AsyncFilesClient(self)
24102410

24112411
async def __aenter__(self) -> AsyncPdfRestClient:
2412-
await super().__aenter__()
2412+
_ = await super().__aenter__()
24132413
return self
24142414

24152415
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)