[child] = filter(lambda ch: ch.name == path[0], self._children)
This sets the child to the first element of the result. This is the syntactic sugar for the list [0] = ... [0]. It can also be two elements, such as [a, b] = [10, 20] , which is sugar for a = 10; b = 20 a = 10; b = 20
In addition, the number of elements on the right side must be the same for the left side, otherwise an exception will be thrown
source share