1- from __future__ import annotations
2-
31from dataclasses import dataclass
4- from typing import Any , ClassVar , Mapping , Tuple , Union
2+ from typing import Any , ClassVar , Tuple , Type , Union
53
64from pydantic import GetCoreSchemaHandler
75from pydantic ._internal import _repr
@@ -15,7 +13,7 @@ class Latitude(float):
1513 max : ClassVar [float ] = 90.00
1614
1715 @classmethod
18- def __get_pydantic_core_schema__ (cls , source : type [Any ], handler : GetCoreSchemaHandler ) -> core_schema .CoreSchema :
16+ def __get_pydantic_core_schema__ (cls , source : Type [Any ], handler : GetCoreSchemaHandler ) -> core_schema .CoreSchema :
1917 return core_schema .float_schema (ge = cls .min , le = cls .max )
2018
2119
@@ -24,19 +22,19 @@ class Longitude(float):
2422 max : ClassVar [float ] = 180.00
2523
2624 @classmethod
27- def __get_pydantic_core_schema__ (cls , source : type [Any ], handler : GetCoreSchemaHandler ) -> core_schema .CoreSchema :
25+ def __get_pydantic_core_schema__ (cls , source : Type [Any ], handler : GetCoreSchemaHandler ) -> core_schema .CoreSchema :
2826 return core_schema .float_schema (ge = cls .min , le = cls .max )
2927
3028
3129@dataclass
3230class Coordinate (_repr .Representation ):
33- _NULL_ISLAND : ClassVar [tuple [float , float ]] = (0.0 , 0.0 )
31+ _NULL_ISLAND : ClassVar [Tuple [float , float ]] = (0.0 , 0.0 )
3432
3533 latitude : Latitude
3634 longitude : Longitude
3735
3836 @classmethod
39- def __get_pydantic_core_schema__ (cls , source : type [Any ], handler : GetCoreSchemaHandler ) -> core_schema .CoreSchema :
37+ def __get_pydantic_core_schema__ (cls , source : Type [Any ], handler : GetCoreSchemaHandler ) -> core_schema .CoreSchema :
4038 schema_chain = [
4139 core_schema .no_info_wrap_validator_function (cls ._parse_str , core_schema .str_schema ()),
4240 core_schema .no_info_wrap_validator_function (
@@ -47,11 +45,10 @@ def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaH
4745 ]
4846
4947 chain_length = len (schema_chain )
50- chain_schemas : list [Mapping [str , Any ]] = [
51- core_schema .chain_schema (schema_chain [x :]) for x in range (chain_length - 1 , - 1 , - 1 )
52- ]
53-
54- return core_schema .no_info_wrap_validator_function (cls ._parse_args , core_schema .union_schema (chain_schemas ))
48+ chain_schemas = [core_schema .chain_schema (schema_chain [x :]) for x in range (chain_length - 1 , - 1 , - 1 )]
49+ return core_schema .no_info_wrap_validator_function (
50+ cls ._parse_args , core_schema .union_schema (chain_schemas ) # type: ignore[arg-type]
51+ )
5552
5653 @classmethod
5754 def _parse_args (cls , value : Any , handler : core_schema .ValidatorFunctionWrapHandler ) -> Any :
0 commit comments