Skip to content

Commit

Permalink
add type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgalli committed Feb 13, 2025
1 parent fc93c50 commit 06bf183
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fsspec_xrootd/xrootd.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ def close(self) -> None:
raise OSError(f"File did not close properly: {status.message}")
self.closed = True

def seek(self, loc, whence=0):
def seek(self, loc: int, whence: int = 0) -> int:
"""Set current file location
Parameters
Expand All @@ -975,11 +975,11 @@ def seek(self, loc, whence=0):
self.loc = nloc
return self.loc

def writable(self):
def writable(self) -> bool:
"""Whether opened for writing"""
return self.mode in {"wb", "ab", "xb", "r+b"} and not self.closed

def write(self, data):
def write(self, data: bytes) -> int:
"""
Write data to buffer.
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def write(self, data):
raise OSError(f"File did not write properly: {status.message}")
return len(data)

def read(self, length=-1):
def read(self, length: int = -1) -> bytes:
"""
Return data from cache, or fetch pieces as necessary
Expand Down

0 comments on commit 06bf183

Please sign in to comment.