Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite4fd2e3

Browse files
committed
Drop wrong variable annotations in BlobFilter.__call__
This fixes two mypy errors by removing the annotations of thefilter_parts and blob_parts local variables as lists. They onlyneed to be sequences (more precisely, they only need to be sizedand iterable, they don't even need to support subscripting in theway __call__ uses them), and mypy is able to infer their type.
1 parent4dfd480 commite4fd2e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎git/index/typ.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# typing ----------------------------------------------------------------------
1414

15-
fromtypingimportNamedTuple,Sequence,TYPE_CHECKING,Tuple,Union,cast,List
15+
fromtypingimportNamedTuple,Sequence,TYPE_CHECKING,Tuple,Union,cast
1616

1717
fromgit.typesimportPathLike
1818

@@ -60,8 +60,8 @@ def __call__(self, stage_blob: Tuple[StageType, Blob]) -> bool:
6060
path:Path=pathlikeifisinstance(pathlike,Path)elsePath(pathlike)
6161
# TODO: Change to use `PosixPath.is_relative_to` once Python 3.8 is no
6262
# longer supported.
63-
filter_parts:List[str]=path.parts
64-
blob_parts:List[str]=blob_path.parts
63+
filter_parts=path.parts
64+
blob_parts=blob_path.parts
6565
iflen(filter_parts)>len(blob_parts):
6666
continue
6767
ifall(i==jfori,jinzip(filter_parts,blob_parts)):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp