Use fully-qualified name

This commit is contained in:
Hynek Schlawack 2021-12-25 14:44:14 +01:00
parent f329fb6105
commit e4e783b18f
1 changed files with 2 additions and 2 deletions

View File

@ -85,9 +85,9 @@ Never again violate the `single responsibility principle <https://en.wikipedia.o
**Hate type annotations**!? **Hate type annotations**!?
No problem! No problem!
With ``attrs`` types are entirely **optional**. With ``attrs`` types are entirely **optional**.
Simply assign ``field()`` to the attributes instead of annotating them with types. Simply assign ``attr.field()`` to the attributes instead of annotating them with types.
In case you're wondering: this example uses ``attrs``'s `modern APIs <https://www.attrs.org/en/stable/api.html#next-generation-apis>`_ that have been introduced in version 20.1.0. This example uses ``attrs``'s `modern APIs <https://www.attrs.org/en/stable/api.html#next-generation-apis>`_ that have been introduced in version 20.1.0.
The classic APIs (``@attr.s``, ``attr.ib``, ``@attr.attrs``, ``attr.attrib``, and ``attr.dataclass``) will remain indefinitely. The classic APIs (``@attr.s``, ``attr.ib``, ``@attr.attrs``, ``attr.attrib``, and ``attr.dataclass``) will remain indefinitely.
Please check out `On The Core API Names <https://www.attrs.org/en/latest/names.html>`_ for a more in-depth explanation. Please check out `On The Core API Names <https://www.attrs.org/en/latest/names.html>`_ for a more in-depth explanation.