Skip to content

Commit

Permalink
Add type hint to remove a "type: ignore" comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Dec 8, 2023
1 parent 8ac7cef commit 51cdc95
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions common/util/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

MYPY = False
if MYPY:
from typing import Mapping, Optional
from typing import Callable, Mapping, Optional


##############
Expand Down Expand Up @@ -91,12 +91,11 @@ def update_view(view, options):
"title": view.set_name,
"scratch": view.set_scratch,
"read_only": view.set_read_only,
}

} # type: Mapping[str, Callable]
settings = view.settings()
for k, v in options.items():
if k in special_setters:
special_setters[k](v) # type: ignore[operator]
special_setters[k](v)
else:
settings.set(k, v)

Expand Down

0 comments on commit 51cdc95

Please sign in to comment.