diff --git a/src/argon2/_utils.py b/src/argon2/_utils.py index 21a6362..697e32a 100644 --- a/src/argon2/_utils.py +++ b/src/argon2/_utils.py @@ -6,7 +6,6 @@ import platform import sys from dataclasses import dataclass -from typing import Any from .exceptions import InvalidHashError, UnsupportedParametersError from .low_level import Type @@ -15,7 +14,7 @@ from .low_level import Type NoneType = type(None) -def _check_types(**kw: Any) -> str | None: +def _check_types(**kw: tuple[object, type | tuple[type, ...]]) -> str | None: """ Check each ``name: (value, types)`` in *kw*. @@ -25,11 +24,11 @@ def _check_types(**kw: Any) -> str | None: for name, (value, types) in kw.items(): if not isinstance(value, types): if isinstance(types, tuple): - types = ", or ".join(t.__name__ for t in types) + type_names = ", or ".join(t.__name__ for t in types) else: - types = types.__name__ + type_names = types.__name__ errors.append( - f"'{name}' must be a {types} (got {type(value).__name__})" + f"'{name}' must be a {type_names} (got {type(value).__name__})" ) if errors != []: diff --git a/tox.ini b/tox.ini index 7952858..c232c2e 100644 --- a/tox.ini +++ b/tox.ini @@ -95,13 +95,13 @@ commands = pyright src tests/typing description = Check API with ty deps = ty dependency_groups = typing -commands = ty check tests/typing +commands = ty check src tests/typing [testenv:typing-pyrefly] description = Check API with pyrefly deps = pyrefly dependency_groups = typing -commands = pyrefly check tests/typing +commands = pyrefly check src tests/typing [testenv:docs-{build,doctests,linkcheck}]