I have the following dict in python:
{main1: {x: 1, y: 2}, main2: {a: 1, b: 2}}
As a result, I need all possible combinations, for example:
{main1: {x: 1}}
{main1: {y: 2}}
{main1: {x: 1, y:2}}
{main2: {a: 1}}
{main1: {x: 1}, main2: {a: 1}}
{main1: {y: 2}, main2: {a: 1}}
{main1: {x: 1, y:2}, main2: {a: 1}}
...
etc .. I feel that there is some kind of pythonic solution, but I can not find it. Any ideas?
source
share