Skip to content

bpo-33961: Adjusted docs to correct exceptions raised. #7917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down