Skip to content

Commit

Permalink
Fix error when subclassing
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 565674887
Change-Id: Ica0fc52583c2f36904aac46909e758a9106fd5bb
  • Loading branch information
Conchylicultor authored and ML Collections Authors committed Sep 15, 2023
1 parent 227b83f commit 091aa2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ml_collections/config_dict/config_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def __setitem__(self, key, value):
if (not isinstance(value, FieldReference) or
value.get_type() is not type(field)):
if isinstance(value, dict) and self._convert_dict:
value = ConfigDict(value, self._type_safe)
value = type(self)(value, self._type_safe)
value = _safe_cast(value, type(field), self._type_safe)
except TypeError as e:
raise TypeError('Could not override field \'{}\' (reference). {}'
Expand Down

0 comments on commit 091aa2b

Please sign in to comment.