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

Commit84fc806

Browse files
committed
Remove some unneeded mypy suppressions
These include suppressions that are no longer required because theyworked around mypy bugs that have been fixed, or because they werenot actually effective. It may also include some that are no longerneeded becuase of improvements made to GitPython's type annotations(or other code) since they were introduced, I am not sure.This deliberately keeps warn_unused_ignores uncommented inpyproject.toml, at least for now.
1 parentaeacb00 commit84fc806

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

‎git/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ def __init__(
344344
configuration files.
345345
"""
346346
cp.RawConfigParser.__init__(self,dict_type=_OMD)
347-
self._dict:Callable[...,_OMD]# type: ignore # mypy/typeshed bug?
347+
self._dict:Callable[...,_OMD]
348348
self._defaults:_OMD
349-
self._sections:_OMD# type: ignore # mypy/typeshed bug?
349+
self._sections:_OMD
350350

351351
# Used in Python 3. Needs to stay in sync with sections for underlying
352352
# implementation to work.

‎git/objects/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def name_rev(self) -> str:
292292
defiter_items(
293293
cls,
294294
repo:"Repo",
295-
rev:Union[str,"Commit","SymbolicReference"],# type: ignore
295+
rev:Union[str,"Commit","SymbolicReference"],
296296
paths:Union[PathLike,Sequence[PathLike]]="",
297297
**kwargs:Any,
298298
)->Iterator["Commit"]:

‎git/objects/tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def cache(self) -> TreeModifier:
300300
returnTreeModifier(self._cache)
301301

302302
deftraverse(
303-
self,# type: ignore[override]
303+
self,
304304
predicate:Callable[[Union[IndexObjUnion,TraversedTreeTup],int],bool]=lambdai,d:True,
305305
prune:Callable[[Union[IndexObjUnion,TraversedTreeTup],int],bool]=lambdai,d:False,
306306
depth:int=-1,
@@ -331,7 +331,7 @@ def traverse(
331331
super()._traverse(
332332
predicate,
333333
prune,
334-
depth,# type: ignore
334+
depth,
335335
branch_first,
336336
visit_once,
337337
ignore_self,

‎git/objects/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ class TraversableIterableObj(IterableObj, Traversable):
619619
deflist_traverse(self:T_TIobj,*args:Any,**kwargs:Any)->IterableList[T_TIobj]:
620620
returnsuper()._list_traverse(*args,**kwargs)
621621

622-
@overload# type: ignore
622+
@overload
623623
deftraverse(self:T_TIobj)->Iterator[T_TIobj]:
624624
...
625625

‎git/refs/reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def iter_items(
150150

151151
# { Remote Interface
152152

153-
@property# type: ignore # mypy cannot deal with properties with an extra decorator (2021-04-21).
153+
@property
154154
@require_remote_ref_path
155155
defremote_name(self)->str:
156156
"""
@@ -162,7 +162,7 @@ def remote_name(self) -> str:
162162
# /refs/remotes/<remote name>/<branch_name>
163163
returntokens[2]
164164

165-
@property# type: ignore # mypy cannot deal with properties with an extra decorator (2021-04-21).
165+
@property
166166
@require_remote_ref_path
167167
defremote_head(self)->str:
168168
"""

‎git/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[
510510
try:
511511
p=osp.expanduser(p)# type: ignore
512512
ifexpand_vars:
513-
p=osp.expandvars(p)# type: ignore
514-
returnosp.normpath(osp.abspath(p))# type: ignore
513+
p=osp.expandvars(p)
514+
returnosp.normpath(osp.abspath(p))
515515
exceptException:
516516
returnNone
517517

‎pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ python_version = "3.8"
2424
disallow_untyped_defs =true
2525
no_implicit_optional =true
2626
warn_redundant_casts =true
27-
#warn_unused_ignores = true
27+
warn_unused_ignores =true
2828
warn_unreachable =true
2929
show_error_codes =true
3030
implicit_reexport =true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp