Skip to content

Commit a9dff13

Browse files
committed
Add some type annotations
Changes in .pyi files are to make mypy happy.
1 parent d0dabe6 commit a9dff13

File tree

8 files changed

+205
-145
lines changed

8 files changed

+205
-145
lines changed

src/borg/archive.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,16 +756,16 @@ def extract_helper(self, item, path, hlm, *, dry_run=False):
756756

757757
def extract_item(
758758
self,
759-
item,
759+
item: Item,
760760
*,
761761
restore_attrs=True,
762762
dry_run=False,
763763
stdout=False,
764764
sparse=False,
765-
hlm=None,
766-
pi=None,
765+
hlm: HardLinkManager | None = None,
766+
pi: ProgressIndicatorPercent | None = None,
767767
continue_extraction=False,
768-
):
768+
) -> None:
769769
"""
770770
Extract archive item.
771771
@@ -779,7 +779,7 @@ def extract_item(
779779
:param continue_extraction: continue a previously interrupted extraction of the same archive
780780
"""
781781

782-
def same_item(item, st):
782+
def same_item(item: Item, st: os.stat_result) -> bool:
783783
"""Is the archived item the same as the filesystem item at the same path with stat st?"""
784784
if not stat.S_ISREG(st.st_mode):
785785
# we only "optimize" for regular files.

0 commit comments

Comments
 (0)