Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
Clarify that immutability isn't recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 16, 2014
1 parent 04a903d commit 2bc9216
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ The easiest way to get started is to have a look at the :doc:`examples` to get a
TypeError: Attribute 'foo' of class 'ImmutableClass' is immutable.


Please note, that that doesn't mean that the attributes themselves are immutable too:

.. doctest::

>>> @immutable(["foo"])
... class C(object):
... foo = []
>>> i = C()
>>> i.foo = [42]
Traceback (most recent call last):
...
TypeError: Attribute 'foo' of class 'C' is immutable.
>>> i.foo.append(42)
>>> i.foo
[42]


.. autoclass:: Attribute

.. autodata:: NOTHING

0 comments on commit 2bc9216

Please sign in to comment.