Skip to content

Commit 759a319

Browse files
path: return annotation bool not int (#29)
Investigating python/mypy#17487, I decided to check out an exemplar mypy_primer to see what all the fuss is about. Since it's so easy to fix this, and so obviously correct, I thought I'd do a PR about it while I'm here. The functions return bool and so should be annotated accordingly, not with int.
1 parent 367cbaf commit 759a319

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

boostedblob/path.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ async def exists(path: Union[BasePath, BlobPath, str]) -> int:
562562

563563

564564
@exists.register # type: ignore
565-
async def _cloud_exists(path: CloudPath) -> int:
565+
async def _cloud_exists(path: CloudPath) -> bool:
566566
# TODO: this is two network requests, make it one
567567
for fut in asyncio.as_completed([isfile(path), isdir(path)]):
568568
if await fut:
@@ -571,7 +571,7 @@ async def _cloud_exists(path: CloudPath) -> int:
571571

572572

573573
@exists.register # type: ignore
574-
async def _local_exists(path: LocalPath) -> int:
574+
async def _local_exists(path: LocalPath) -> bool:
575575
return os.path.exists(path)
576576

577577

0 commit comments

Comments
 (0)