[Python-checkins] bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917)

Eric V. Smith webhook-mailer at python.org
Mon Jul 2 06:22:02 EDT 2018


https://github.com/python/cpython/commit/24d74bd8377d38528566437e70fcd72229695ac7
commit: 24d74bd8377d38528566437e70fcd72229695ac7
branch: 3.7
author: Chris Cogdon <chris at cogdon.org>
committer: Eric V. Smith <ericvsmith at users.noreply.github.com>
date: 2018-07-02T06:21:50-04:00
summary:

bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917)

files:
M Doc/library/dataclasses.rst

diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index b26f6422db91..9835c480d0ea 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -60,8 +60,9 @@ Module-level decorators, classes, and functions
 
    The :func:`dataclass` decorator will add various "dunder" methods to
    the class, described below.  If any of the added methods already
-   exist on the class, a :exc:`TypeError` will be raised.  The decorator
-   returns the same class that is called on: no new class is created.
+   exist on the class, the behavior depends on the parameter, as documented
+   below. The decorator returns the same class that is called on; no new
+   class is created.
 
    If :func:`dataclass` is used just as a simple decorator with no parameters,
    it acts as if it has the default values documented in this
@@ -115,7 +116,7 @@ Module-level decorators, classes, and functions
 
      If the class already defines any of :meth:`__lt__`,
      :meth:`__le__`, :meth:`__gt__`, or :meth:`__ge__`, then
-     :exc:`ValueError` is raised.
+     :exc:`TypeError` is raised.
 
    - ``unsafe_hash``: If ``False`` (the default), a :meth:`__hash__` method
      is generated according to how ``eq`` and ``frozen`` are set.



More information about the Python-checkins mailing list