I want to generate a list of unique nested keys for each value in a dictionary such that: I thought something along these lines would work, appending each key to a list and recursing until a value is reached. At which point I yield a list and carry on. However when running, the result is all the unique keys Think