You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.rst
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,14 @@ Core
17
17
----
18
18
19
19
20
-
.. warning::
21
-
As of ``attrs`` 20.1.0, it also ships with a bunch of provisional APIs that are intended to become the main way of defining classes in the future.
20
+
.. note::
21
+
22
+
``attrs`` 20.1.0 added a bunch of nicer APIs (sometimes referred to as next generation -- or NG -- APIs) that were intended to become the main way of defining classes in the future.
23
+
As of 21.1.0, they are not provisional anymore and are the **recommended** way to use ``attrs``!
24
+
The next step will be adding an importable ``attrs`` namespace.
25
+
The documentation will be updated successively.
22
26
23
-
Please have a look at :ref:`prov`.
27
+
Please have a look at :ref:`next-gen`!
24
28
25
29
.. autodata:: attr.NOTHING
26
30
@@ -578,12 +582,12 @@ These are helpers that you can use together with `attr.s`'s and `attr.ib`'s ``on
578
582
N.B. Please use `attr.s`'s *frozen* argument to freeze whole classes; it is more efficient.
579
583
580
584
581
-
.. _prov:
585
+
.. _next-gen:
582
586
583
-
Provisional APIs
584
-
----------------
587
+
Next Generation APIs
588
+
--------------------
585
589
586
-
These are Python 3.6 and later-only, keyword-only, and **provisional** APIs that call `attr.s` with different default values.
590
+
These are Python 3.6 and later-only, and keyword-only APIs that call `attr.s` with different default values.
587
591
588
592
The most notable differences are:
589
593
@@ -597,14 +601,9 @@ The most notable differences are:
597
601
598
602
Please note that these are *defaults* and you're free to override them, just like before.
599
603
600
-
----
601
-
602
-
Their behavior is scheduled to become part of the upcoming ``import attrs`` that will introduce a new namespace with nicer names and nicer defaults (see `#408 <https://github.com/python-attrs/attrs/issues/408>`_ and `#487 <https://github.com/python-attrs/attrs/issues/487>`_).
603
-
604
-
Therefore your constructive feedback in the linked issues above is strongly encouraged!
604
+
Since the Python ecosystem has settled on the term ``field`` for defining attributes, we have also added `attr.field` as a substitute for `attr.ib`.
605
605
606
606
.. note::
607
-
Provisional doesn't mean we will remove it (although it will be deprecated once the final form is released), but that it might change if we receive relevant feedback.
608
607
609
608
`attr.s` and `attr.ib` (and their serious business cousins) aren't going anywhere.
0 commit comments