]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355) (#108358)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 23 Aug 2023 11:46:03 +0000 (04:46 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Aug 2023 11:46:03 +0000 (13:46 +0200)
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 79fdacc0059a3959074d2d9d054653eae1dcfe06)

Co-authored-by: FrozenBob <30644137+FrozenBob@users.noreply.github.com>
Doc/library/dataclasses.rst

index 535a60ccca8d07bdee4a978cdbf30dffaf9aed0f..d68748767c5e377d1090d4524ccea11073529238 100644 (file)
@@ -609,7 +609,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
 -----------