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 9bc1b68 commit 7cf0ad3Copy full SHA for 7cf0ad3
brainpy/tools/dicts.py
@@ -97,18 +97,6 @@ def add_attr_not_key(self, *args):
97
raise TypeError('Only support string.')
98
self.attrs_not_keys += args
99
100
- def __setitem__(self, key, value):
101
- """Overload bracket assignment to catch potential conflicts during assignment."""
102
- if key in self:
103
- if id(self[key]) != id(value):
104
- raise ValueError(f'Name "{key}" conflicts: same name for {value} and {self[key]}.')
105
- dict.__setitem__(self, key, value)
106
-
107
- def replace(self, key, new_value):
108
- """Replace the original key with the new value."""
109
- self.pop(key)
110
- self[key] = new_value
111
112
def update(self, *args, **kwargs):
113
super().update(*args, **kwargs)
114
return self
0 commit comments