File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2868,10 +2868,19 @@ def make_class(
28682868 r"""
28692869 A quick way to create a new class called *name* with *attrs*.
28702870
2871+ .. note::
2872+
2873+ This function is a thin wrapper around `attr.s`, not `attrs.define`
2874+ which means that it doesn't come with some of the improved defaults.
2875+
2876+ For example, if you want the same `on_setattr` behavior as in
2877+ `attrs.define`, you have to pass the hooks yourself: ``make_class(...,
2878+ on_setattr=setters.pipe(setters.convert, setters.validate)``
2879+
28712880 Args:
28722881 name (str): The name for the new class.
28732882
2874- attrs( list | dict):
2883+ attrs ( list | dict):
28752884 A list of names or a dictionary of mappings of names to `attr.ib`\
28762885 s / `attrs.field`\ s.
28772886
You can’t perform that action at this time.
0 commit comments