diff options
Diffstat (limited to 'Lib/dataclasses.py')
-rw-r--r-- | Lib/dataclasses.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 8c197fe..bd7252c 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -248,11 +248,11 @@ class Field: # the default value, so the end result is a descriptor that had # __set_name__ called on it at the right time. def __set_name__(self, owner, name): - func = getattr(self.default, '__set_name__', None) + func = getattr(type(self.default), '__set_name__', None) if func: # There is a __set_name__ method on the descriptor, # call it. - func(owner, name) + func(self.default, owner, name) class _DataclassParams: |