Better way to fix evolve docs
This commit is contained in:
parent
b7919d0ddd
commit
8ed593b954
12
docs/api.rst
12
docs/api.rst
|
@ -193,7 +193,7 @@ See :ref:`asdict` for examples.
|
||||||
|
|
||||||
.. autofunction:: attr.evolve
|
.. autofunction:: attr.evolve
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
.. doctest::
|
.. doctest::
|
||||||
|
|
||||||
|
@ -210,12 +210,12 @@ For example:
|
||||||
>>> i1 == i2
|
>>> i1 == i2
|
||||||
False
|
False
|
||||||
|
|
||||||
``evolve`` creates a new instance using ``__init__``.
|
``evolve`` creates a new instance using ``__init__``.
|
||||||
This fact has several implications:
|
This fact has several implications:
|
||||||
|
|
||||||
* private attributes should be specified without the leading underscore, just like in ``__init__``.
|
* private attributes should be specified without the leading underscore, just like in ``__init__``.
|
||||||
* attributes with ``init=False`` can't be set with ``evolve``.
|
* attributes with ``init=False`` can't be set with ``evolve``.
|
||||||
* the usual ``__init__`` validators will validate the new values.
|
* the usual ``__init__`` validators will validate the new values.
|
||||||
|
|
||||||
.. autofunction:: validate
|
.. autofunction:: validate
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue