This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wt
Recipients r.david.murray, wt
Date 2014-03-06.21:53:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394142811.41.0.143991735197.issue20860@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-03-06 21:53:31wtsetrecipients: + wt, r.david.murray
2014-03-06 21:53:31wtsetmessageid: <1394142811.41.0.143991735197.issue20860@psf.upfronthosting.co.za>
2014-03-06 21:53:31wtlinkissue20860 messages
2014-03-06 21:53:31wtcreate