Add type annotations to misc.objects

This commit is contained in:
Florian Bruhin 2018-11-29 11:08:24 +01:00
parent ccab751d3c
commit 4caa2e056b

View File

@ -22,14 +22,20 @@
# NOTE: We need to be careful with imports here, as this is imported from
# earlyinit.
import typing
MYPY = False
if MYPY:
# pylint: disable=unused-import,useless-suppression
from qutebrowser.utils import usertypes
class NoBackend:
"""Special object when there's no backend set so we notice that."""
def __eq__(self, other):
def __eq__(self, other: typing.Any) -> bool:
raise AssertionError("No backend set!")
# A usertypes.Backend member
backend = NoBackend()
backend = NoBackend() # type: typing.Union[usertypes.Backend, NoBackend]