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

Method _format_num

src/marshmallow/fields.py:977–979  ·  view source on GitHub ↗

Return the number value for value, given this field's `num_type`.

(self, value)

Source from the content-addressed store, hash-verified

975 super().__init__(**kwargs)
976
977 def _format_num(self, value) -> _NumT:
978 """Return the number value for value, given this field's `num_type`."""
979 return self.num_type(value) # type: ignore[call-arg]
980
981 def _validated(self, value: typing.Any) -> _NumT:
982 """Format the value or raise a :exc:`ValidationError` if an error occurs."""

Callers 2

_validatedMethod · 0.95
_serializeMethod · 0.95

Calls 1

num_typeMethod · 0.95

Tested by

no test coverage detected