@@ -25,7 +25,7 @@ def __init__(cls, name: str, bases: tuple[type, ...], namespace: dict[str, objec
2525
2626 default_vals [field .name ] = field .get_default ()
2727 if default_vals [field .name ] is None and not field .allow_none :
28- raise ValueError (f" { model_cls .__name__ } .{ field .name } must have a default value" )
28+ raise ValueError (f' { model_cls .__name__ } .{ field .name } must have a default value' )
2929
3030 values , fields_set , validation_error = \
3131 validate_model (model_cls , input_data = {k : v for k , v in default_vals .items ()})
@@ -40,7 +40,7 @@ def __getattr__(cls, attr: str) -> object:
4040 model_cls = cast (type [BaseModel ], cls )
4141 if attr in model_cls .__fields__ :
4242 return cls ._get_param_value (attr , model_cls )
43- raise AttributeError (f" { model_cls .__name__ } .{ attr } is not defined" )
43+ raise AttributeError (f' { model_cls .__name__ } .{ attr } is not defined' )
4444
4545 @functools .cache
4646 def _get_param_value (cls , attr , model_cls ):
@@ -52,9 +52,9 @@ def _get_param_value(cls, attr, model_cls):
5252 def __setattr__ (cls , attr : str , value : object ) -> None :
5353 model_cls = cast (type [BaseModel ], cls )
5454 if attr in model_cls .__fields__ :
55- raise AttributeError (f" { model_cls .__name__ } .{ attr } is read-only" )
55+ raise AttributeError (f' { model_cls .__name__ } .{ attr } is read-only' )
5656 elif not attr .startswith ('_' ):
57- raise AttributeError (f" { model_cls .__name__ } .{ attr } is not defined" )
57+ raise AttributeError (f' { model_cls .__name__ } .{ attr } is not defined' )
5858 super ().__setattr__ (attr , value )
5959
6060
@@ -64,7 +64,7 @@ class Config:
6464 smart_union = True
6565
6666 def __new__ (cls , * args : object , ** kwargs : object ) -> None : # type: ignore[misc]
67- raise RuntimeError (f" { cls .__name__ } cannot be instantiated" )
67+ raise RuntimeError (f' { cls .__name__ } cannot be instantiated' )
6868
6969 @classmethod
7070 def copy_and_adjust (cls , model_name : str , ** kwargs : object ) -> type ['ParamsBase' ]:
0 commit comments