Skip to content

Commit d0e6d85

Browse files
committed
fixup! Apply suggestions from code review
1 parent f80245e commit d0e6d85

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

fsspec/caching.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,6 @@ def __init__(
471471
self.data = data
472472

473473
def _fetch(self, start: int | None, stop: int | None) -> bytes:
474-
if start is None:
475-
start = 0
476-
if stop is None:
477-
stop = len(self.data)
478474
return self.data[start:stop]
479475

480476

fsspec/utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,7 @@ def read_block(
295295
length = end - start
296296

297297
f.seek(offset)
298-
if length is not None:
299-
b = f.read(length)
300-
else:
301-
b = f.read()
298+
b = f.read(length) # type: ignore[arg-type]
302299
return b
303300

304301

@@ -347,14 +344,14 @@ def stringify_path(filepath: str | os.PathLike[str] | pathlib.Path) -> str:
347344
"""
348345
if isinstance(filepath, str):
349346
return filepath
350-
elif hasattr(filepath, "__fspath__") or isinstance(filepath, os.PathLike):
347+
elif hasattr(filepath, "__fspath__"):
351348
return filepath.__fspath__()
352349
elif isinstance(filepath, pathlib.Path):
353350
return str(filepath)
354351
elif hasattr(filepath, "path"):
355352
return filepath.path
356353
else:
357-
return filepath
354+
return filepath # type: ignore[return-value]
358355

359356

360357
def make_instance(

0 commit comments

Comments
 (0)