Skip to content

Commit

Permalink
utils/settings: Generalize type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Jul 1, 2020
1 parent 095556d commit 49275f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Orange/widgets/utils/settings.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import typing
from typing import Any, Union, Tuple, Dict, List
from typing import Any, Union, Tuple, Dict, List, Mapping, Sequence

from PyQt5.QtCore import QSettings

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


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


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


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

0 comments on commit 49275f6

Please sign in to comment.