Skip to content

Commit

Permalink
fix field order breaking on py35/36
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimidzija committed Nov 21, 2021
1 parent 8ab5c4e commit df37ea1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/marshmallow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ def __init__(
self.fields = {} # type: typing.Dict[str, ma_fields.Field]
self.load_fields = {} # type: typing.Dict[str, ma_fields.Field]
self.dump_fields = {} # type: typing.Dict[str, ma_fields.Field]
self.dump_serializers = {} # type: typing.Dict[str, typing.Callable]
self.dump_serializers = (
self.dict_class()
) # type: typing.Dict[str, typing.Callable]
self._init_fields()
messages = {}
messages.update(self._default_error_messages)
Expand Down Expand Up @@ -1040,7 +1042,7 @@ def _init_fields(self) -> None:
self.fields = fields_dict
self.dump_fields = dump_fields
self.load_fields = load_fields
self.dump_serializers = {}
self.dump_serializers = self.dict_class()

def on_bind_field(self, field_name: str, field_obj: ma_fields.Field) -> None:
"""Hook to modify a field when it is bound to the `Schema`.
Expand Down

0 comments on commit df37ea1

Please sign in to comment.