@@ -224,7 +224,13 @@ def __get_validators__(cls) -> 'CallableGenerator':
224224
225225
226226def conint (
227- * , strict : bool = False , gt : int = None , ge : int = None , lt : int = None , le : int = None , multiple_of : int = None
227+ * ,
228+ strict : bool = False ,
229+ gt : Optional [int ] = None ,
230+ ge : Optional [int ] = None ,
231+ lt : Optional [int ] = None ,
232+ le : Optional [int ] = None ,
233+ multiple_of : Optional [int ] = None ,
228234) -> Type [int ]:
229235 # use kwargs then define conf in a dict to aid with IDE type hinting
230236 namespace = dict (strict = strict , gt = gt , ge = ge , lt = lt , le = le , multiple_of = multiple_of )
@@ -296,11 +302,11 @@ def __get_validators__(cls) -> 'CallableGenerator':
296302def confloat (
297303 * ,
298304 strict : bool = False ,
299- gt : float = None ,
300- ge : float = None ,
301- lt : float = None ,
302- le : float = None ,
303- multiple_of : float = None ,
305+ gt : Optional [ float ] = None ,
306+ ge : Optional [ float ] = None ,
307+ lt : Optional [ float ] = None ,
308+ le : Optional [ float ] = None ,
309+ multiple_of : Optional [ float ] = None ,
304310) -> Type [float ]:
305311 # use kwargs then define conf in a dict to aid with IDE type hinting
306312 namespace = dict (strict = strict , gt = gt , ge = ge , lt = lt , le = le , multiple_of = multiple_of )
@@ -360,8 +366,8 @@ def conbytes(
360366 strip_whitespace : bool = False ,
361367 to_upper : bool = False ,
362368 to_lower : bool = False ,
363- min_length : int = None ,
364- max_length : int = None ,
369+ min_length : Optional [ int ] = None ,
370+ max_length : Optional [ int ] = None ,
365371 strict : bool = False ,
366372) -> Type [bytes ]:
367373 # use kwargs then define conf in a dict to aid with IDE type hinting
@@ -433,10 +439,10 @@ def constr(
433439 to_upper : bool = False ,
434440 to_lower : bool = False ,
435441 strict : bool = False ,
436- min_length : int = None ,
437- max_length : int = None ,
438- curtail_length : int = None ,
439- regex : str = None ,
442+ min_length : Optional [ int ] = None ,
443+ max_length : Optional [ int ] = None ,
444+ curtail_length : Optional [ int ] = None ,
445+ regex : Optional [ str ] = None ,
440446) -> Type [str ]:
441447 # use kwargs then define conf in a dict to aid with IDE type hinting
442448 namespace = dict (
@@ -497,7 +503,7 @@ def set_length_validator(cls, v: 'Optional[Set[T]]') -> 'Optional[Set[T]]':
497503 return v
498504
499505
500- def conset (item_type : Type [T ], * , min_items : int = None , max_items : int = None ) -> Type [Set [T ]]:
506+ def conset (item_type : Type [T ], * , min_items : Optional [ int ] = None , max_items : Optional [ int ] = None ) -> Type [Set [T ]]:
501507 # __args__ is needed to conform to typing generics api
502508 namespace = {'min_items' : min_items , 'max_items' : max_items , 'item_type' : item_type , '__args__' : [item_type ]}
503509 # We use new_class to be able to deal with Generic types
@@ -539,7 +545,9 @@ def frozenset_length_validator(cls, v: 'Optional[FrozenSet[T]]') -> 'Optional[Fr
539545 return v
540546
541547
542- def confrozenset (item_type : Type [T ], * , min_items : int = None , max_items : int = None ) -> Type [FrozenSet [T ]]:
548+ def confrozenset (
549+ item_type : Type [T ], * , min_items : Optional [int ] = None , max_items : Optional [int ] = None
550+ ) -> Type [FrozenSet [T ]]:
543551 # __args__ is needed to conform to typing generics api
544552 namespace = {'min_items' : min_items , 'max_items' : max_items , 'item_type' : item_type , '__args__' : [item_type ]}
545553 # We use new_class to be able to deal with Generic types
@@ -595,7 +603,11 @@ def unique_items_validator(cls, v: 'List[T]') -> 'List[T]':
595603
596604
597605def conlist (
598- item_type : Type [T ], * , min_items : int = None , max_items : int = None , unique_items : bool = None
606+ item_type : Type [T ],
607+ * ,
608+ min_items : Optional [int ] = None ,
609+ max_items : Optional [int ] = None ,
610+ unique_items : Optional [bool ] = None ,
599611) -> Type [List [T ]]:
600612 # __args__ is needed to conform to typing generics api
601613 namespace = dict (
@@ -704,13 +716,13 @@ def validate(cls, value: Decimal) -> Decimal:
704716
705717def condecimal (
706718 * ,
707- gt : Decimal = None ,
708- ge : Decimal = None ,
709- lt : Decimal = None ,
710- le : Decimal = None ,
711- max_digits : int = None ,
712- decimal_places : int = None ,
713- multiple_of : Decimal = None ,
719+ gt : Optional [ Decimal ] = None ,
720+ ge : Optional [ Decimal ] = None ,
721+ lt : Optional [ Decimal ] = None ,
722+ le : Optional [ Decimal ] = None ,
723+ max_digits : Optional [ int ] = None ,
724+ decimal_places : Optional [ int ] = None ,
725+ multiple_of : Optional [ Decimal ] = None ,
714726) -> Type [Decimal ]:
715727 # use kwargs then define conf in a dict to aid with IDE type hinting
716728 namespace = dict (
@@ -1165,10 +1177,10 @@ def __get_validators__(cls) -> 'CallableGenerator':
11651177
11661178def condate (
11671179 * ,
1168- gt : date = None ,
1169- ge : date = None ,
1170- lt : date = None ,
1171- le : date = None ,
1180+ gt : Optional [ date ] = None ,
1181+ ge : Optional [ date ] = None ,
1182+ lt : Optional [ date ] = None ,
1183+ le : Optional [ date ] = None ,
11721184) -> Type [date ]:
11731185 # use kwargs then define conf in a dict to aid with IDE type hinting
11741186 namespace = dict (gt = gt , ge = ge , lt = lt , le = le )
0 commit comments