mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
[3.12] gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355) (#108358)
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 79fdacc005
)
Co-authored-by: FrozenBob <30644137+FrozenBob@users.noreply.github.com>
This commit is contained in:
parent
0d6e657689
commit
3aa7df6544
1 changed files with 1 additions and 1 deletions
|
@ -609,7 +609,7 @@ methods will raise a :exc:`FrozenInstanceError` when invoked.
|
||||||
|
|
||||||
There is a tiny performance penalty when using ``frozen=True``:
|
There is a tiny performance penalty when using ``frozen=True``:
|
||||||
:meth:`~object.__init__` cannot use simple assignment to initialize fields, and
|
:meth:`~object.__init__` cannot use simple assignment to initialize fields, and
|
||||||
must use :meth:`~object.__setattr__`.
|
must use :meth:`!object.__setattr__`.
|
||||||
|
|
||||||
Inheritance
|
Inheritance
|
||||||
-----------
|
-----------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue