Пример #1
0
 class Configuration:
     JSON_FIELD: dict = field(converter=json.loads)
     KV_FIELD: dict = field(converter=csv_pairs)
Пример #2
0
 class Config:
     FIELD: int = field(validator=range(3))
Пример #3
0
 class Config:
     FIELD: int = field(validator=1)
Пример #4
0
 class Config:
     FIELD: int = field(validator=lambda x: x % 2 == 0)
Пример #5
0
 class Config:
     FIELD: str = field(validator="abcd")
Пример #6
0
 class Config:
     FIELD: int = field(validator=[1, 3, 4])