variable typing
This commit is contained in:
@@ -27,7 +27,7 @@ class HookedMapping(HookedContainer[T], MutableMapping[T, MutableNesting[T]]):
|
|||||||
case MutableMapping() as mapping:
|
case MutableMapping() as mapping:
|
||||||
new_path = copy(self._path)
|
new_path = copy(self._path)
|
||||||
new_path.append(key)
|
new_path.append(key)
|
||||||
return HookedMapping(self.hook, existing=mapping, path=new_path)
|
return type(self)(self.hook, existing=mapping, path=new_path)
|
||||||
case MutableSequence() as seq:
|
case MutableSequence() as seq:
|
||||||
new_path = copy(self._path)
|
new_path = copy(self._path)
|
||||||
new_path.append(key)
|
new_path.append(key)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class HookedList(HookedContainer[T], MutableSequence[T]):
|
|||||||
new_path = copy(self._path)
|
new_path = copy(self._path)
|
||||||
new_path.append(s)
|
new_path.append(s)
|
||||||
# print(new_path)
|
# print(new_path)
|
||||||
return HookedList(self.hook, existing=seq, path=new_path)
|
return type(self)(self.hook, existing=seq, path=new_path)
|
||||||
case _ as item:
|
case _ as item:
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user