Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
Remove deprecated Constant field
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Mar 5, 2020
1 parent 7746732 commit d70b044
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
6 changes: 4 additions & 2 deletions RELEASES.rst
Expand Up @@ -6,7 +6,8 @@ Releases

*Unreleased*

- Improve ``ValidationError`` messages for container fields.
- Remove deprecated ``Constant`` field.
- Improve ``ValidationError`` messages for container fields. (`7746732`_)
- Rename ``BaseField`` to ``_Base``. (`c5abc2f`_)
- Add ``frozenset`` to FIELD_CLASS_MAP. (`24d7c0e`_)
- Add ``Flatten`` field. (`9c740a5`_)
Expand All @@ -17,7 +18,6 @@ Releases
- Completely rework error handling. (`c95b6b3`_)
- Make ``Tag.lookup_tag`` default to module + qualname. (`26963d6`_)

.. _c5abc2f: https://github.com/rossmacarthur/serde/commit/c5abc2f1d36e9c0857dc1ea65e4536be4c7397ef
.. _26963d6: https://github.com/rossmacarthur/serde/commit/26963d65b45229db50444665a3160bd0f1358421
.. _c95b6b3: https://github.com/rossmacarthur/serde/commit/c95b6b329125164e3301a7e43292c7a858d5e34f
.. _2a54886: https://github.com/rossmacarthur/serde/commit/2a548865106b1cfc98f5dea8bf00084f62e6334e
Expand All @@ -26,6 +26,8 @@ Releases
.. _34783b0: https://github.com/rossmacarthur/serde/commit/34783b03084acffc1fd1cddf4c987d3855d45330
.. _9c740a5: https://github.com/rossmacarthur/serde/commit/9c740a5e9f40b1d913f2d718947f7204e87c6ffa
.. _24d7c0e: https://github.com/rossmacarthur/serde/commit/24d7c0e3320226837586b214ad3dfc0d95852ddb
.. _c5abc2f: https://github.com/rossmacarthur/serde/commit/c5abc2f1d36e9c0857dc1ea65e4536be4c7397ef
.. _7746732: https://github.com/rossmacarthur/serde/commit/7746732d2180d6bd9cbf141475f87409b7977343

0.7.3
-----
Expand Down
12 changes: 0 additions & 12 deletions src/serde/fields.py
Expand Up @@ -912,18 +912,6 @@ def validate(self, value):
)


class Constant(Literal):
"""
Deprecated, use `Literal`.
"""

def __init__(self, value, **kwargs):
"""
Create a new `Constant`.
"""
super(Constant, self).__init__(value, **kwargs)


class Choice(Field):
"""
One of a given selection of values.
Expand Down
9 changes: 0 additions & 9 deletions tests/test_fields.py
Expand Up @@ -13,7 +13,6 @@
Bytes,
Choice,
Complex,
Constant,
Date,
DateTime,
Deque,
Expand Down Expand Up @@ -1203,14 +1202,6 @@ def test_validate(self):
assert field.validate(False)


class TestConstant:
def test___init__(self):
# Construct a basic Constant and check values are set correctly.
field = Constant(1)
assert field.value == 1
assert field.validators == []


class TestChoice:
def test___init__(self):
# Construct a basic Choice and check values are set correctly.
Expand Down

0 comments on commit d70b044

Please sign in to comment.