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 pitrou
Recipients ncoghlan, pitrou, pmoody, serhiy.storchaka
Date 2014-05-15.21:24:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400189077.88.0.327979647169.issue21513@psf.upfronthosting.co.za>
In-reply-to
Content
Some properties on IPv4Address and IPv6Address instantiate one or several network objects each time they are computed. Instead these characteristic networks can be computed once and for all at module import. Patch attached.

(note: the lru_cache() decorator seems to mitigate this in micro-benchmarks, but the common pattern is not to call .is_private on always the same address :-))
History
Date User Action Args
2014-05-15 21:24:38pitrousetrecipients: + pitrou, ncoghlan, pmoody, serhiy.storchaka
2014-05-15 21:24:37pitrousetmessageid: <1400189077.88.0.327979647169.issue21513@psf.upfronthosting.co.za>
2014-05-15 21:24:37pitroulinkissue21513 messages
2014-05-15 21:24:37pitroucreate