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(
2868
2868
r"""
2869
2869
A quick way to create a new class called *name* with *attrs*.
2870
2870
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
+
2871
2880
Args:
2872
2881
name (str): The name for the new class.
2873
2882
2874
- attrs( list | dict):
2883
+ attrs ( list | dict):
2875
2884
A list of names or a dictionary of mappings of names to `attr.ib`\
2876
2885
s / `attrs.field`\ s.
2877
2886
You can’t perform that action at this time.
0 commit comments