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 fb9ea67 commit 602e660Copy full SHA for 602e660
1 file changed
src/attr/_make.py
@@ -2014,11 +2014,13 @@ def _make_init_script(
2014
attr_dict[a.name] = a
2015
2016
if a.on_setattr is not None:
2017
- if frozen is True:
+ if a.on_setattr is setters.NO_OP:
2018
+ pass
2019
+ elif frozen is True:
2020
msg = "Frozen classes can't use on_setattr."
2021
raise ValueError(msg)
-
- needs_cached_setattr = True
2022
+ else:
2023
+ needs_cached_setattr = True
2024
elif has_cls_on_setattr and a.on_setattr is not setters.NO_OP:
2025
needs_cached_setattr = True
2026
0 commit comments