Skip to content

Commit

Permalink
Document how to circumvent frozeness
Browse files Browse the repository at this point in the history
fixes #196
  • Loading branch information
hynek committed May 23, 2017
1 parent 04e171a commit 0dea63c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ def attributes(maybe_cls=None, these=None, repr_ns=None,
<how-frozen>` when initializing new instances. In other words:
``__init__`` is slightly slower with ``frozen=True``.
4. If a class is frozen, you cannot modify ``self`` in
``__attrs_post_init__``. You can circumvent that limitation by
using ``object.__setattr__(self, "attribute_name", value)``.
.. _slots: https://docs.python.org/3.5/reference/datamodel.html#slots
.. versionadded:: 16.0.0 *slots*
Expand Down

0 comments on commit 0dea63c

Please sign in to comment.