Created
March 19, 2017 11:11
-
-
Save nvgoldin/d7ad6233108afd092d0107c664a0a109 to your computer and use it in GitHub Desktop.
getting nets
This file contains 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
In [1]: class vm(object): | |
...: def __init__(self, nets): | |
...: self.nets = nets | |
...: | |
In [2]: vms = [ vm(nets=['1', '2']), vm(nets=['2', '9']), vm(nets=['3', '2']) ] | |
In [3]: set((net for vm in vms for net in vm.nets)) | |
Out[3]: {'1', '2', '3', '9'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment