Created
June 6, 2013 19:12
-
-
Save ionelmc/5724083 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> import itertools | |
| >>> [ | |
| ... 'queue_%s' % '_'.join(str(node) for node in combination) | |
| ... for combination in itertools.chain(*[ | |
| ... itertools.combinations(range(4), i) for i in range(1, 5) | |
| ... ]) | |
| ... ] | |
| ['queue_0', 'queue_1', 'queue_2', 'queue_3', 'queue_0_1', 'queue_0_2', 'queue_0_3', 'queue_1_2', 'queue_1_3', 'queue_2_3', 'queue_0_1_2', 'queue_0_1_3', 'queue_0_2_3', 'queue_1_2_3', 'queue_0_1_2_3'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment