Skip to content

Commit 625f0e9

Browse files
committed
Introduce VAnnotation
1 parent efa9030 commit 625f0e9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/cattrs/v/__init__.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Cattrs validation."""
2-
from typing import Callable, List, Union
2+
from typing import Any, Callable, List, Union
3+
4+
from attrs import frozen
35

46
from .._compat import ExceptionGroup
57
from ..errors import (
@@ -31,6 +33,13 @@
3133
]
3234

3335

36+
@frozen
37+
class VAnnotation:
38+
"""Use this with Annotated to get validation."""
39+
40+
validators: tuple[Callable[[Any], Any]]
41+
42+
3443
def format_exception(exc: BaseException, type: Union[type, None]) -> str:
3544
"""The default exception formatter, handling the most common exceptions.
3645

0 commit comments

Comments
 (0)