Skip to content

Commit

Permalink
Introduce VAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Feb 3, 2024
1 parent 0e2c564 commit fd22d45
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/cattrs/v/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Cattrs validation."""
from typing import Callable, List, Union
from typing import Any, Callable, List, Union

from attrs import frozen

from .._compat import ExceptionGroup
from ..errors import (
Expand Down Expand Up @@ -31,6 +33,13 @@
]


@frozen
class VAnnotation:
"""Use this with Annotated to get validation."""

validators: tuple[Callable[[Any], Any]]


def format_exception(exc: BaseException, type: Union[type, None]) -> str:
"""The default exception formatter, handling the most common exceptions.
Expand Down

0 comments on commit fd22d45

Please sign in to comment.