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
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ API Reference
3
3
4
4
.. currentmodule:: attr
5
5
6
-
``attrs`` works by decorating a class using `attrs.define` or `attr.s` and then optionally defining attributes on the class using `attrs.field`, `attr.ib`, or a type annotation.
6
+
*attrs* works by decorating a class using `attrs.define` or `attr.s` and then optionally defining attributes on the class using `attrs.field`, `attr.ib`, or a type annotation.
7
7
8
8
If you're confused by the many names, please check out `names` for clarification.
9
9
10
10
What follows is the API explanation, if you'd like a more hands-on introduction, have a look at `examples`.
11
11
12
-
As of version 21.3.0, ``attrs`` consists of **two** top-level package names:
12
+
As of version 21.3.0, *attrs* consists of **two** top-level package names:
13
13
14
14
- The classic ``attr`` that powered the venerable `attr.s` and `attr.ib`
15
15
- The modern ``attrs`` that only contains most modern APIs and relies on `attrs.define` and `attrs.field` to define your classes.
@@ -124,7 +124,7 @@ Classic
124
124
125
125
.. note::
126
126
127
-
``attrs`` also comes with a serious-business alias ``attr.attrs``.
127
+
*attrs* also comes with a serious-business alias ``attr.attrs``.
128
128
129
129
For example:
130
130
@@ -164,7 +164,7 @@ Classic
164
164
165
165
.. note::
166
166
167
-
``attrs`` also comes with a serious-business alias ``attr.attrib``.
167
+
*attrs* also comes with a serious-business alias ``attr.attrib``.
168
168
169
169
The object returned by `attr.ib` also allows for setting the default and the validator using decorators:
170
170
@@ -228,7 +228,7 @@ That means that it doesn't matter from from which namespace they've been raised
228
228
Helpers
229
229
-------
230
230
231
-
``attrs`` comes with a bunch of helper methods that make working with it easier:
231
+
*attrs* comes with a bunch of helper methods that make working with it easier:
232
232
233
233
.. autofunction:: attrs.cmp_using
234
234
.. function:: attr.cmp_using
@@ -357,7 +357,7 @@ Helpers
357
357
.. autofunction:: attr.astuple
358
358
359
359
360
-
``attrs`` includes some handy helpers for filtering the attributes in `attrs.asdict` and `attrs.astuple`:
360
+
*attrs* includes some handy helpers for filtering the attributes in `attrs.asdict` and `attrs.astuple`:
361
361
362
362
.. autofunction:: attrs.filters.include
363
363
@@ -440,7 +440,7 @@ Validators can be globally disabled if you want to run them only in development
440
440
Validators
441
441
----------
442
442
443
-
``attrs`` comes with some common validators in the ``attrs.validators`` module.
443
+
*attrs* comes with some common validators in the ``attrs.validators`` module.
444
444
All objects from ``attrs.validators`` are also available from ``attr.validators``.
0 commit comments