Skip to content

Commit 49275f6

Browse files
committed
utils/settings: Generalize type hints
1 parent 095556d commit 49275f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Orange/widgets/utils/settings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import typing
2-
from typing import Any, Union, Tuple, Dict, List
2+
from typing import Any, Union, Tuple, Dict, List, Mapping, Sequence
33

44
from PyQt5.QtCore import QSettings
55

66
if typing.TYPE_CHECKING: # pragma: no cover
7-
_T = typing.TypeVar("T")
7+
_T = typing.TypeVar("_T")
88
#: Specification for an value in the return value of readArray
99
#: Can be single type or a tuple of (type, defaultValue) where default
1010
#: value is used where a stored entry is missing.
@@ -14,7 +14,7 @@
1414

1515

1616
def QSettings_readArray(settings, key, scheme):
17-
# type: (QSettings, str, Dict[str, ValueSpec]) -> List[Dict[str, Any]]
17+
# type: (QSettings, str, Mapping[str, ValueSpec]) -> List[Dict[str, Any]]
1818
"""
1919
Read the whole array from a QSettings instance.
2020
@@ -61,7 +61,7 @@ def normalize_spec(spec):
6161

6262

6363
def QSettings_writeArray(settings, key, values):
64-
# type: (QSettings, str, List[Dict[str, Any]]) -> None
64+
# type: (QSettings, str, Sequence[Mapping[str, Any]]) -> None
6565
"""
6666
Write an array of values to a QSettings instance.
6767
@@ -87,7 +87,7 @@ def QSettings_writeArray(settings, key, values):
8787

8888

8989
def QSettings_writeArrayItem(settings, key, index, item, arraysize):
90-
# type: (QSettings, str, int, Dict[str, Any], int) -> None
90+
# type: (QSettings, str, int, Mapping[str, Any], int) -> None
9191
"""
9292
Write/update an array item at index.
9393

0 commit comments

Comments
 (0)