diff --git a/src/hooked_containers/container.py b/src/hooked_containers/container.py index e76483f..7376de6 100644 --- a/src/hooked_containers/container.py +++ b/src/hooked_containers/container.py @@ -1,6 +1,5 @@ from abc import ABC, abstractmethod from collections.abc import Container, Iterable, MutableMapping, MutableSequence, Sized -from copy import copy from typing import Protocol, TypeVar from . import events as e @@ -57,9 +56,7 @@ class HookedContainer(ABC, Sized, Iterable[T], Container[T]): # Custom Methods def new_path(self, key): - new_path = copy(self._path) - new_path.append(key) - return new_path + return (*self._path, key) def get_nested(self, keys): """Recursively call __getitem__ with each key in the iterable."""