From 5644d211f13c163259a62ec0ee7f2022838354d6 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 2 Sep 2020 08:20:55 +0200 Subject: [PATCH] Clarify what need to be reset and when Signed-off-by: Hynek Schlawack --- src/attr/_make.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/attr/_make.py b/src/attr/_make.py index 1d0ee375f..f77b5bc8f 100644 --- a/src/attr/_make.py +++ b/src/attr/_make.py @@ -669,8 +669,9 @@ def _create_slots_class(self): if k not in tuple(self._attr_names) + ("__dict__", "__weakref__") } - # Check the bases if one of them has an attrs-made __setattr__ that - # needs to be reset. + # If our class doesn't have an own __setattr__ (either from the user or + # by us), check the bases, if one of them has an attrs-made + # __setattr__, that needs to be reset. # XXX: This can be confused by subclassing a slotted attrs class with # XXX: a non-attrs class and subclass the resulting class with an attrs # XXX: class. See `test_slotted_confused for details. For now that's