Skip to content

Commit

Permalink
[3.12] gh-108267: Fix object.__setattr__ regression in dataclasses do…
Browse files Browse the repository at this point in the history
…cs (GH-119082) (#119098)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
  • Loading branch information
miss-islington and hauntsaninja authored May 16, 2024
1 parent 0a761ca commit a3db4e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,8 @@ 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:`!__setattr__`.
must use :meth:`!object.__setattr__`.
.. Make sure to not remove "object" from "object.__setattr__" in the above markup
.. _dataclasses-inheritance:

Expand Down

0 comments on commit a3db4e8

Please sign in to comment.