mypy: Fix new issues in utils.objreg

For window_registry, the index is the win_id
This commit is contained in:
Florian Bruhin 2019-10-22 10:06:06 +02:00
parent 290f55e609
commit 7b9d70203f
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ class ObjectRegistry(collections.UserDict):
} # type: typing.MutableMapping[str, typing.Callable[[], None]]
self.command_only = [] # type: typing.MutableSequence[str]
def __setitem__(self, name: str, obj: typing.Any) -> None:
def __setitem__(self, name: typing.Union[int, str],
obj: typing.Any) -> None:
"""Register an object in the object registry.
Sets a slot to remove QObjects when they are destroyed.