]> granicus.if.org Git - python/commitdiff
Pep 557 What's New (GH-5371)
authorEric V. Smith <ericvsmith@users.noreply.github.com>
Sun, 28 Jan 2018 01:30:37 +0000 (20:30 -0500)
committerGitHub <noreply@github.com>
Sun, 28 Jan 2018 01:30:37 +0000 (20:30 -0500)
Add PEP 557 Data CLasses to What's New.

Doc/whatsnew/3.7.rst

index 1ece6a3befd28797183c613b15213d8f69a4beb6..5e355345e31dc146919c1405d7423a14a694f872 100644 (file)
@@ -311,6 +311,24 @@ environment variable are added to control the UTF-8 mode.
        PEP written and implemented by Victor Stinner
 
 
+.. _whatsnew37-pep557:
+
+PEP 557: Data Classes
+---------------------
+
+Adds a new module ``dataclasses``.  It provides a class decorator
+``dataclass`` which inspects the class's variable annotations (see
+:pep:`526`) and using them, adds methods such as ``__init__``,
+``__repr__``, and ``__eq__`` to the class.  It is similar to
+``typing.NamedTuple``, but also works on classes with mutable
+instances, among other features.
+
+.. seealso::
+
+    :pep:`557` -- Data Classes
+       PEP written and implemented by Eric V. Smith
+
+
 New Development Mode: -X dev
 ----------------------------