We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94234ac commit ea26aebCopy full SHA for ea26aeb
src/marshmallow/validate.py
@@ -75,8 +75,8 @@ def _repr_args(self) -> str:
75
return f"validators={self.validators!r}"
76
77
def __call__(self, value: typing.Any) -> typing.Any:
78
- errors = []
79
- kwargs = {}
+ errors: list[str | dict] = []
+ kwargs: dict[str, typing.Any] = {}
80
for validator in self.validators:
81
try:
82
r = validator(value)
@@ -93,8 +93,7 @@ def __call__(self, value: typing.Any) -> typing.Any:
93
if isinstance(err.messages, dict):
94
errors.append(err.messages)
95
else:
96
- # FIXME : Get rid of cast
97
- errors.extend(typing.cast(list, err.messages))
+ errors.extend(err.messages)
98
if errors:
99
raise ValidationError(errors, **kwargs)
100
return value
0 commit comments