Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbueno committed Sep 19, 2024
1 parent 51fd981 commit 900072d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions extradict/nested_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ def __getitem__(self, index):
return wrapped[subpath]
return wrapped

def __setitem__(self, index, item, allow_growing=False):
def __setitem__(self, index, item):
return self._setitem(index, item, False, False)

def _setitem(self, index, item, merging=False, allow_growing=True):
## provides simmetry to _NestedDict, so that some codepaths
## can be simplified
if isinstance(index, slice):
self.data[index] = item
return
Expand Down Expand Up @@ -332,11 +337,6 @@ def insert(self, index, item):
int(index), item if not isinstance(item, NestedData) else item.data
)

def _setitem(self, index, value, merging=False):
# provides simmetry to _NestedDict, so that some codepaths
# can be simplified
return self.__setitem__(index, value, allow_growing=True)

def merge(self, data, path=None):
data = self.unwrap(data)
if path in (None, ""):
Expand Down

0 comments on commit 900072d

Please sign in to comment.