Skip to content

Commit

Permalink
fix: fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jul 11, 2022
1 parent 81c145f commit d45b97c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/app_model/registries/_menus_reg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from __future__ import annotations

from typing import Callable, Dict, Final, Iterator, List, Optional, Sequence, Set, Tuple
from typing import (
Any,
Callable,
Dict,
Final,
Iterator,
List,
Optional,
Sequence,
Set,
Tuple,
)

from psygnal import Signal

Expand Down Expand Up @@ -39,7 +50,11 @@ def append_menu_items(
menu_list = self._menu_items.setdefault(menu_id, [])
menu_list.append(item)
changed_ids.add(menu_id)
disposers.append(lambda: menu_list.remove(item))

def _remove(lst: list = menu_list, _item: Any = item) -> None:
lst.remove(_item)

disposers.append(_remove)

def _dispose() -> None:
for disposer in disposers:
Expand Down

0 comments on commit d45b97c

Please sign in to comment.