Skip to content

Commit 6520402

Browse files
committed
Use less tpes of typing
1 parent 68c5594 commit 6520402

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

flask_inputfilter/input_filter.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections.abc import Callable
4-
from typing import Any, Optional, Tuple, Type, TypeVar, Union
4+
from typing import Any, Optional, Type, TypeVar, Union
55

66
from flask import Response
77

@@ -32,8 +32,8 @@ class InputFilter:
3232
) -> Callable[
3333
[Any],
3434
Callable[
35-
[Tuple[Any, ...], dict[str, Any]],
36-
Union[Response, Tuple[Any, dict[str, Any]]],
35+
[tuple[Any, ...], dict[str, Any]],
36+
Union[Response, tuple[Any, dict[str, Any]]],
3737
],
3838
]: ...
3939
def validateData(

flask_inputfilter/validators/is_dataclass_validator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import dataclasses
4-
from typing import Any, Optional, Tuple, Type, TypeVar, Union, _GenericAlias
4+
from typing import Any, Optional, Type, TypeVar, Union, _GenericAlias
55

66
from flask_inputfilter.exceptions import ValidationError
77
from flask_inputfilter.validators import BaseValidator
@@ -216,7 +216,7 @@ def _validate_list_type(
216216
self,
217217
field_name: str,
218218
field_value: Any,
219-
args: Tuple[Type, ...],
219+
args: tuple[Type, ...],
220220
parent_value: dict[str, Any],
221221
) -> None:
222222
"""Validate list[T] type."""
@@ -246,7 +246,7 @@ def _validate_dict_type(
246246
self,
247247
field_name: str,
248248
field_value: Any,
249-
args: Tuple[Type, ...],
249+
args: tuple[Type, ...],
250250
parent_value: dict[str, Any],
251251
) -> None:
252252
"""Validate dict[K, V] type."""
@@ -286,7 +286,7 @@ def _validate_union_type(
286286
self,
287287
field_name: str,
288288
field_value: Any,
289-
args: Tuple[Type, ...],
289+
args: tuple[Type, ...],
290290
parent_value: dict[str, Any],
291291
) -> None:
292292
"""Validate Union types, particularly Optional[T]."""

0 commit comments

Comments
 (0)