diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 6f71a8c04..eb885816f 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -36,7 +36,7 @@ import functools import operator import json import dataclasses -from typing import Any, Optional, Union, TypeAlias +from typing import Any, Union, TypeAlias from re import Pattern from collections.abc import Iterable, Iterator, Sequence, Callable @@ -66,7 +66,7 @@ BOOLEAN_STATES = {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False} -_Completions: TypeAlias = Optional[Iterable[tuple[str, str]]] +_Completions: TypeAlias = Iterable[tuple[str, str]] | None _StrUnset: TypeAlias = str | usertypes.Unset _UnsetNone: TypeAlias = None | usertypes.Unset _StrUnsetNone: TypeAlias = str | _UnsetNone diff --git a/qutebrowser/config/configutils.py b/qutebrowser/config/configutils.py index 3fb5da51c..07cf9d990 100644 --- a/qutebrowser/config/configutils.py +++ b/qutebrowser/config/configutils.py @@ -9,7 +9,7 @@ import collections import itertools import operator from typing import ( - TYPE_CHECKING, Any, Optional, TypeAlias) + TYPE_CHECKING, Any, TypeAlias) from collections.abc import Iterator, Sequence, MutableMapping from qutebrowser.qt.core import QUrl @@ -69,7 +69,7 @@ class Values: _domain_map: A mapping from hostnames to all associated ScopedValues. """ - _VmapKeyType: TypeAlias = Optional[urlmatch.UrlPattern] + _VmapKeyType: TypeAlias = urlmatch.UrlPattern | None def __init__(self, opt: 'configdata.Option',