The code is not written to handle cases that have nested data structures and in case the nested list won't match word for word, it would fully return the elements as they have not found any match. IMO the compare results need to call itself in case it encounters a dict or a list and retry matching.
The code is not written to handle cases that have nested data structures and in case the nested list won't match word for word, it would fully return the elements as they have not found any match. IMO the compare results need to call itself in case it encounters a dict or a list and retry matching.