We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3f320e commit e82cde4Copy full SHA for e82cde4
1 file changed
src/attr/_make.py
@@ -2868,10 +2868,19 @@ def make_class(
2868
r"""
2869
A quick way to create a new class called *name* with *attrs*.
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
2880
Args:
2881
name (str): The name for the new class.
2882
- attrs( list | dict):
2883
+ attrs (list | dict):
2884
A list of names or a dictionary of mappings of names to `attr.ib`\
2885
s / `attrs.field`\ s.
2886
0 commit comments