Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-02-24 17:03:55 -08:00
parent 218c6b4672
commit dedbe43c3e
101 changed files with 7680 additions and 857 deletions

View File

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class LengthUnit(int):
""""""
def __int__(self) -> int:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(int))