diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 1f2e45741..41309d352 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -22,6 +22,7 @@ import copy import contextlib import functools +import typing from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject @@ -30,11 +31,15 @@ from qutebrowser.utils import utils, log, jinja from qutebrowser.misc import objects from qutebrowser.keyinput import keyutils +MYPY = False +if MYPY: + from qutebrowser.config import configcache + # An easy way to access the config from other code via config.val.foo -val = None -instance = None -key_instance = None -cache = None +val = typing.cast('ConfigContainer', None) +instance = typing.cast('Config', None) +key_instance = typing.cast('KeyConfig', None) +cache = typing.cast('configcache.ConfigCache', None) # Keeping track of all change filters to validate them later. change_filters = []