Message212844
Won't that instantiate an object for each item in the list though? For example:
>>> list(net.subnets(prefixlen_diff=16))[499]
This take a long time. I was trying to think of a way to lazily instantiate.
For example, I don't want to create 65536 network objects (like above) if I am looking for the 500th /24 subnet of 10.0.0.0/8. The following executes much more quickly:
>>> ipa.ip_network((10 << 24) + (499 << 8))
That essentially what the __getattr__ method should do. Of course, it might also be nice to have a __len__ on that object. |
|
Date |
User |
Action |
Args |
2014-03-06 21:53:31 | wt | set | recipients:
+ wt, r.david.murray |
2014-03-06 21:53:31 | wt | set | messageid: <1394142811.41.0.143991735197.issue20860@psf.upfronthosting.co.za> |
2014-03-06 21:53:31 | wt | link | issue20860 messages |
2014-03-06 21:53:31 | wt | create | |
|