diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 5611b24a4..52d13dcf7 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -387,7 +387,9 @@ def _bind_to_schema(self, field_name, schema): self.parent.root if isinstance(self.parent, FieldABC) else self.parent ) - def _serialize(self, value: typing.Any, attr: str, obj: typing.Any, **kwargs): + def _serialize( + self, value: typing.Any, attr: str | None, obj: typing.Any, **kwargs + ): """Serializes ``value`` to a basic Python datatype. Noop by default. Concrete :class:`Field` classes should implement this method.