diff --git a/koans/about_attribute_access.py b/koans/about_attribute_access.py index f12f61143..c3bd95eb7 100644 --- a/koans/about_attribute_access.py +++ b/koans/about_attribute_access.py @@ -103,9 +103,7 @@ def __getattribute__(self, attr_name): # Guess what happens when self.no_of_getattribute_calls is # accessed? - # Using 'object' directly because using super() here will also - # trigger a __getattribute__() call. - return object.__getattribute__(self, attr_name) + return super().__getattribute__(attr_name) def my_method(self): pass @@ -158,7 +156,7 @@ def __setattr__(self, attr_name, value): elif attr_name[-3:] == 'pie': new_attr_name = "a_" + new_attr_name - object.__setattr__(self, new_attr_name, value) + super().__setattr__(new_attr_name, value) def test_setattr_intercepts_attribute_assignments(self): fanboy = self.PossessiveSetter() @@ -188,7 +186,7 @@ def __setattr__(self, attr_name, value): if attr_name[0] != '_': new_attr_name = "altered_" + new_attr_name - object.__setattr__(self, new_attr_name, value) + super().__setattr__(new_attr_name, value) def test_it_modifies_external_attribute_as_expected(self): setter = self.ScarySetter()