MCPcopy
hub / github.com/marshmallow-code/marshmallow / _deserialize

Method _deserialize

src/marshmallow/fields.py:1224–1240  ·  view source on GitHub ↗
(
        self,
        value: typing.Any,
        attr: str | None,
        data: typing.Mapping[str, typing.Any] | None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

1222 self.falsy = set(falsy)
1223
1224 def _deserialize(
1225 self,
1226 value: typing.Any,
1227 attr: str | None,
1228 data: typing.Mapping[str, typing.Any] | None,
1229 **kwargs,
1230 ) -> bool:
1231 if not self.truthy:
1232 return bool(value)
1233 try:
1234 if value in self.truthy:
1235 return True
1236 if value in self.falsy:
1237 return False
1238 except TypeError as error:
1239 raise self.make_error("invalid", input=value) from error
1240 raise self.make_error("invalid", input=value)
1241
1242
1243_D = typing.TypeVar("_D", dt.datetime, dt.date, dt.time)

Callers

nothing calls this directly

Calls 1

make_errorMethod · 0.80

Tested by

no test coverage detected