Skip to content

Commit

Permalink
Fix Field._serialize typing
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Sep 8, 2022
1 parent f61dc84 commit 2de97bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2de97bc

Please sign in to comment.