borg icon indicating copy to clipboard operation
borg copied to clipboard

add more type annotations

Open ThomasWaldmann opened this issue 3 years ago • 2 comments

In master branch, mypy is integrated into CI, but most of the code does not have type annotations yet.

ThomasWaldmann avatar Jul 15 '22 13:07 ThomasWaldmann

Hello, I might get arround to adding some type annotations. I annotated a few files just to try it out, and I thought I would ask for guidance before continuing.

This is probably too overkill, right? 😅 (looking at the generics in datastruct.py) Would you prefer this precise approach, or just using Any when it gets too complicated?

kulisak12 avatar Sep 24 '25 14:09 kulisak12

@kulisak12 I sometimes rather used Any if it got too complicated. :-)

Also, I guess type annotations are maybe most useful at the places that deal with data that gets persisted into the repository. A small steps approach here is likely better managable than a big global refactoring.

ThomasWaldmann avatar Sep 24 '25 15:09 ThomasWaldmann