Skip to content

Commit aaeba93

Browse files
committed
Prepare 18.2.0
1 parent 839a605 commit aaeba93

17 files changed

+49
-32
lines changed

CHANGELOG.rst

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,58 @@ Changelog
44
Versions follow `CalVer <https://calver.org>`_ with a strict backwards compatibility policy.
55
The third digit is only for regressions.
66

7-
Changes for the upcoming release can be found in the `"changelog.d" directory <https://github.com/python-attrs/attrs/tree/master/changelog.d>`_ in our repository.
7+
.. towncrier release notes start
88
9-
..
10-
Do *NOT* add changelog entries here!
9+
18.2.0 (2018-09-01)
10+
-------------------
1111

12-
This changelog is managed by towncrier and is compiled at release time.
12+
Deprecations
13+
^^^^^^^^^^^^
1314

14-
See https://www.attrs.org/en/latest/contributing.html#changelog for details.
15+
- Comparing subclasses using ``<``, ``>``, ``<=``, and ``>=`` is now deprecated.
16+
The docs always claimed that instances are only compared if the types are identical, so this is a first step to conform to the docs.
17+
18+
Equality operators (``==`` and ``!=``) were always strict in this regard.
19+
`#394 <https://github.com/python-attrs/attrs/issues/394>`_
20+
21+
22+
Changes
23+
^^^^^^^
24+
25+
- ``attrs`` now ships its own `PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_ type hints.
26+
Together with `mypy <http://mypy-lang.org>`_'s ``attrs`` plugin, you've got all you need for writing statically typed code in both Python 2 and 3!
27+
28+
At that occasion, we've also added `narrative docs <https://www.attrs.org/en/stable/types.html>`_ about type annotations in ``attrs``.
29+
`#238 <https://github.com/python-attrs/attrs/issues/238>`_
30+
- Added *kw_only* arguments to ``attr.ib`` and ``attr.s``, and a corresponding *kw_only* attribute to ``attr.Attribute``.
31+
This change makes it possible to have a generated ``__init__`` with keyword-only arguments on Python 3, relaxing the required ordering of default and non-default valued attributes.
32+
`#281 <https://github.com/python-attrs/attrs/issues/281>`_,
33+
`#411 <https://github.com/python-attrs/attrs/issues/411>`_
34+
- The test suite now runs with ``hypothesis.HealthCheck.too_slow`` disabled to prevent CI breakage on slower computers.
35+
`#364 <https://github.com/python-attrs/attrs/issues/364>`_,
36+
`#396 <https://github.com/python-attrs/attrs/issues/396>`_
37+
- ``attr.validators.in_()`` now raises a ``ValueError`` with a useful message even if the options are a string and the value is not a string.
38+
`#383 <https://github.com/python-attrs/attrs/issues/383>`_
39+
- ``attr.asdict()`` now properly handles deeply nested lists and dictionaries.
40+
`#395 <https://github.com/python-attrs/attrs/issues/395>`_
41+
- Added ``attr.converters.default_if_none()`` that allows to replace ``None`` values in attributes.
42+
For example ``attr.ib(converter=default_if_none(""))`` replaces ``None`` by empty strings.
43+
`#400 <https://github.com/python-attrs/attrs/issues/400>`_,
44+
`#414 <https://github.com/python-attrs/attrs/issues/414>`_
45+
- Fixed a reference leak where the original class would remain live after being replaced when ``slots=True`` is set.
46+
`#407 <https://github.com/python-attrs/attrs/issues/407>`_
47+
- Slotted classes can now be made weakly referenceable by passing ``@attr.s(weakref_slot=True)``.
48+
`#420 <https://github.com/python-attrs/attrs/issues/420>`_
49+
- Added *cache_hash* option to ``@attr.s`` which causes the hash code to be computed once and stored on the object.
50+
`#425 <https://github.com/python-attrs/attrs/issues/425>`_
51+
- Attributes can be named ``property`` and ``itemgetter`` now.
52+
`#430 <https://github.com/python-attrs/attrs/issues/430>`_
53+
- It is now possible to override a base class' class variable using only class annotations.
54+
`#431 <https://github.com/python-attrs/attrs/issues/431>`_
55+
56+
57+
----
1558

16-
.. towncrier release notes start
1759

1860
18.1.0 (2018-05-03)
1961
-------------------

changelog.d/238.change.rst

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

changelog.d/281.change.rst

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

changelog.d/364.change.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/383.change.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/394.deprecation.rst

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

changelog.d/395.change.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/396.change.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/400.change.rst

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

changelog.d/407.change.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)