Skip to content

Commit fdbcc1e

Browse files
desertisra17
authored andcommitted
Update changelog
1 parent 1b08af5 commit fdbcc1e

File tree

4 files changed

+52
-33
lines changed

4 files changed

+52
-33
lines changed

CHANGELOG.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
2022.09.22 (2022-09-22)
2+
-----------------------
3+
4+
5+
Backward-incompatible Changes
6+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
- Update all project dependencies and fix all deprecated warnings. Python 3.6
9+
support was dropped to allow updating deprecated dependencies.
10+
`#161 <https://github.com/python-desert/desert/issues/161>`_
11+
12+
13+
Changes
14+
^^^^^^^
15+
16+
- It is now possible to use `type-variant generics`_ in your dataclasses, such as ``Sequence``
17+
or ``MutableSequence`` instead of ``List``, ``Mapping`` instead of ``Dict``, etc.
18+
19+
This allows you to hide implementation details from users of your dataclasses. If a field
20+
in your dataclass works just as fine with a tuple as a list, you no longer need to force
21+
your users to pass in a ``list`` just to satisfy type checkers.
22+
23+
For example, by using ``Mapping`` or ``MutableMapping``, users can pass ``OrderedDict`` to
24+
a ``Dict`` attribute without MyPy complaining.
25+
26+
.. code-block:: python
27+
28+
@dataclass
29+
class OldWay:
30+
str_list: List[str]
31+
num_map: Dict[str, float]
32+
33+
34+
# MyPy will reject this even though Marshmallow works just fine. If you use
35+
# type-variant generics, MyPy will accept this code.
36+
instance = OldClass([], collections.ChainMap(MY_DEFAULTS))
37+
38+
39+
@dataclass
40+
class NewWay:
41+
str_list: List[str] # Type-invariants still work
42+
num_map: MutableMapping[str, float] # Now generics do too
43+
44+
45+
.. _type-variant generics: https://mypy.readthedocs.io/en/stable/generics.html
46+
`#140 <https://github.com/python-desert/desert/issues/140>`_
47+
48+
49+
----
50+
51+
152
2020.11.18 (2020-11-18)
253
-----------------------
354

changelog.d/140.change.rst

Lines changed: 0 additions & 30 deletions
This file was deleted.

changelog.d/161.breaking.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ known_first_party = desert
2929
default_section = THIRDPARTY
3030
forced_separate = test_desert
3131
skip = migrations
32-
known_third_party=attr,marshmallow,pytest,setuptools,typing_inspect
32+
known_third_party=_pytest,attr,marshmallow,pytest,setuptools,typing_extensions,typing_inspect
3333
extend_skip =
3434
.flake8
3535
dev-requirements.in

0 commit comments

Comments
 (0)