py3.12/refac: AfterValidator -> StringConstraints

This commit is contained in:
Jörn-Michael Miehe 2023-10-19 13:54:39 +02:00
parent ddde3bd024
commit a585d97f9f

View file

@ -9,11 +9,11 @@ from functools import total_ordering
from logging import getLogger
from typing import Annotated, Self
from pydantic import AfterValidator, BaseModel, ConfigDict
from pydantic import BaseModel, ConfigDict, StringConstraints
from vobject.base import Component
_logger = getLogger(__name__)
StrippedStr = Annotated[str, AfterValidator(lambda s: s.strip())]
type StrippedStr = Annotated[str, StringConstraints(strip_whitespace=True)]
@total_ordering