Skip to content

Commit

Permalink
Add EnumSymbol and EnumValue docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Aug 25, 2022
1 parent a23a2c4 commit a503d78
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,12 @@ class IPv6Interface(IPInterface):


class EnumSymbol(String):
"""An Enum field (de)serializing enum members by symbol (name) as string.
:param enum Enum: Enum class
.. versionadded:: 3.18.0
"""

default_error_messages = {
"unknown": "Must be one of: {choices}.",
Expand All @@ -1883,7 +1889,15 @@ def _deserialize(self, value, attr, data, **kwargs):


class EnumValue(Field):
"""Base class for typed Enum fields"""
"""An Enum field (de)serializing enum members by value.
A Field must be provided to (de)serialize the value.
:param cls_or_instance: Field class or instance.
:param enum Enum: Enum class
.. versionadded:: 3.18.0
"""

default_error_messages = {
"unknown": "Must be one of: {choices}.",
Expand Down

0 comments on commit a503d78

Please sign in to comment.