Skip to content

Commit

Permalink
Remove default and missing properties (#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria authored Dec 30, 2024
1 parent 20d19a7 commit 47f0930
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions src/marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,48 +418,6 @@ def context(self):
"""The context dictionary for the parent :class:`Schema`."""
return self.parent.context

# the default and missing properties are provided for compatibility and
# emit warnings when they are accessed and set
@property
def default(self):
warnings.warn(
"The 'default' attribute of fields is deprecated. "
"Use 'dump_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
return self.dump_default

@default.setter
def default(self, value):
warnings.warn(
"The 'default' attribute of fields is deprecated. "
"Use 'dump_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
self.dump_default = value

@property
def missing(self):
warnings.warn(
"The 'missing' attribute of fields is deprecated. "
"Use 'load_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
return self.load_default

@missing.setter
def missing(self, value):
warnings.warn(
"The 'missing' attribute of fields is deprecated. "
"Use 'load_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
self.load_default = value


class Raw(Field):
"""Field that applies no formatting."""
Expand Down

0 comments on commit 47f0930

Please sign in to comment.