Skip to content

Commit

Permalink
[3.11] gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-1…
Browse files Browse the repository at this point in the history
…08355) (#108357)

gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355)

Fixed a sentence in dataclasses.rst

Changed "__setattr__" to "object.__setattr__" in a section that was specifically supposed to refer to the __setattr__ method of the object class. Also suppressed the link to the data model docs for __setattr__, since we're talking about a specific __setattr__ implementation, not __setattr__ methods in general.
(cherry picked from commit 79fdacc)

Co-authored-by: FrozenBob <30644137+FrozenBob@users.noreply.github.com>
  • Loading branch information
miss-islington and FrozenBob authored Aug 23, 2023
1 parent 1aff195 commit 1ecbe78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ methods will raise a :exc:`FrozenInstanceError` when invoked.

There is a tiny performance penalty when using ``frozen=True``:
:meth:`~object.__init__` cannot use simple assignment to initialize fields, and
must use :meth:`~object.__setattr__`.
must use :meth:`!object.__setattr__`.

Inheritance
-----------
Expand Down

0 comments on commit 1ecbe78

Please sign in to comment.