@@ -22,22 +22,21 @@ def asdict(
22
22
Optionally recurse into other *attrs*-decorated classes.
23
23
24
24
:param inst: Instance of an *attrs*-decorated class.
25
- :param bool recurse: Recurse into classes that are also
26
- *attrs*-decorated.
27
- :param callable filter: A callable whose return code determines whether an
28
- attribute or element is included (``True``) or dropped (``False``). Is
29
- called with the `attrs.Attribute` as the first argument and the
30
- value as the second argument.
31
- :param callable dict_factory: A callable to produce dictionaries from. For
32
- example, to produce ordered dictionaries instead of normal Python
33
- dictionaries, pass in ``collections.OrderedDict``.
34
- :param bool retain_collection_types: Do not convert to ``list`` when
35
- encountering an attribute whose type is ``tuple`` or ``set``. Only
36
- meaningful if ``recurse`` is ``True``.
37
- :param Optional[callable] value_serializer: A hook that is called for every
38
- attribute or dict key/value. It receives the current instance, field
39
- and value and must return the (updated) value. The hook is run *after*
40
- the optional *filter* has been applied.
25
+ :param bool recurse: Recurse into classes that are also *attrs*-decorated.
26
+ :param ~typing.Callable filter: A callable whose return code determines
27
+ whether an attribute or element is included (`True`) or dropped
28
+ (`False`). Is called with the `attrs.Attribute` as the first argument
29
+ and the value as the second argument.
30
+ :param ~typing.Callable dict_factory: A callable to produce dictionaries
31
+ from. For example, to produce ordered dictionaries instead of normal
32
+ Python dictionaries, pass in ``collections.OrderedDict``.
33
+ :param bool retain_collection_types: Do not convert to `list` when
34
+ encountering an attribute whose type is `tuple` or `set`. Only
35
+ meaningful if *recurse* is `True`.
36
+ :param typing.Callable | None value_serializer: A hook that is called for
37
+ every attribute or dict key/value. It receives the current instance,
38
+ field and value and must return the (updated) value. The hook is run
39
+ *after* the optional *filter* has been applied.
41
40
42
41
:rtype: return type of *dict_factory*
43
42
@@ -207,18 +206,16 @@ def astuple(
207
206
Optionally recurse into other *attrs*-decorated classes.
208
207
209
208
:param inst: Instance of an *attrs*-decorated class.
210
- :param bool recurse: Recurse into classes that are also
211
- *attrs*-decorated.
212
- :param callable filter: A callable whose return code determines whether an
213
- attribute or element is included (``True``) or dropped (``False``). Is
214
- called with the `attrs.Attribute` as the first argument and the
215
- value as the second argument.
216
- :param callable tuple_factory: A callable to produce tuples from. For
217
- example, to produce lists instead of tuples.
218
- :param bool retain_collection_types: Do not convert to ``list``
219
- or ``dict`` when encountering an attribute which type is
220
- ``tuple``, ``dict`` or ``set``. Only meaningful if ``recurse`` is
221
- ``True``.
209
+ :param bool recurse: Recurse into classes that are also *attrs*-decorated.
210
+ :param ~typing.Callable filter: A callable whose return code determines
211
+ whether an attribute or element is included (`True`) or dropped
212
+ (`False`). Is called with the `attrs.Attribute` as the first argument
213
+ and the value as the second argument.
214
+ :param ~typing.Callable tuple_factory: A callable to produce tuples from.
215
+ For example, to produce lists instead of tuples.
216
+ :param bool retain_collection_types: Do not convert to `list` or `dict`
217
+ when encountering an attribute which type is `tuple`, `dict` or `set`.
218
+ Only meaningful if *recurse* is `True`.
222
219
223
220
:rtype: return type of *tuple_factory*
224
221
0 commit comments