Add type annotations to misc.objects
This commit is contained in:
parent
ccab751d3c
commit
4caa2e056b
@ -22,14 +22,20 @@
|
|||||||
# NOTE: We need to be careful with imports here, as this is imported from
|
# NOTE: We need to be careful with imports here, as this is imported from
|
||||||
# earlyinit.
|
# earlyinit.
|
||||||
|
|
||||||
|
import typing
|
||||||
|
|
||||||
|
MYPY = False
|
||||||
|
if MYPY:
|
||||||
|
# pylint: disable=unused-import,useless-suppression
|
||||||
|
from qutebrowser.utils import usertypes
|
||||||
|
|
||||||
|
|
||||||
class NoBackend:
|
class NoBackend:
|
||||||
|
|
||||||
"""Special object when there's no backend set so we notice that."""
|
"""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!")
|
raise AssertionError("No backend set!")
|
||||||
|
|
||||||
|
|
||||||
# A usertypes.Backend member
|
backend = NoBackend() # type: typing.Union[usertypes.Backend, NoBackend]
|
||||||
backend = NoBackend()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user