mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
[3.13] gh-108267: Fix object.__setattr__ regression in dataclasses docs (GH-119082) (#119097)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
parent
8a4730e95e
commit
c69fe804b6
1 changed files with 2 additions and 1 deletions
|
@ -615,7 +615,8 @@ 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:`!__setattr__`.
|
must use :meth:`!object.__setattr__`.
|
||||||
|
.. Make sure to not remove "object" from "object.__setattr__" in the above markup
|
||||||
|
|
||||||
.. _dataclasses-inheritance:
|
.. _dataclasses-inheritance:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue