Skip to content

Commit

Permalink
docs: add note to make_class about non-NG-ness
Browse files Browse the repository at this point in the history
fixes #1375
  • Loading branch information
hynek committed Dec 15, 2024
1 parent d3f320e commit e82cde4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2868,10 +2868,19 @@ def make_class(
r"""
A quick way to create a new class called *name* with *attrs*.
.. note::
This function is a thin wrapper around `attr.s`, not `attrs.define`
which means that it doesn't come with some of the improved defaults.
For example, if you want the same `on_setattr` behavior as in
`attrs.define`, you have to pass the hooks yourself: ``make_class(...,
on_setattr=setters.pipe(setters.convert, setters.validate)``
Args:
name (str): The name for the new class.
attrs( list | dict):
attrs (list | dict):
A list of names or a dictionary of mappings of names to `attr.ib`\
s / `attrs.field`\ s.
Expand Down

0 comments on commit e82cde4

Please sign in to comment.