Skip to content

Commit

Permalink
BUG: Fix annotation type associated with _toolbars variable
Browse files Browse the repository at this point in the history
Follow-up of 91c17c7 ("ENH: Refactor HomeWidget to support custom toolbars", 2024-08-21)
updating the annotation to use the mutable type `dict` usable as annotation
type in Python >= 3.9.

Co-authored-by: Shreeraj Jadhav <[email protected]>
  • Loading branch information
jcfr and jadh4v committed Aug 22, 2024
1 parent a46147c commit 53b3d00
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions {{cookiecutter.project_name}}/Modules/Scripted/Home/Home.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from collections.abc import Mapping
from typing import Optional

import qt
Expand Down Expand Up @@ -44,7 +43,7 @@ class HomeWidget(ScriptedLoadableModuleWidget, VTKObservationMixin):
def toolbarNames(self) -> list[str]:
return [str(k) for k in self._toolbars]

_toolbars: Mapping[str, qt.QToolBar] = {}
_toolbars: dict[str, qt.QToolBar] = {}

def __init__(self, parent: Optional[qt.QWidget]):
"""Called when the application opens the module the first time and the widget is initialized."""
Expand Down

0 comments on commit 53b3d00

Please sign in to comment.