Message233049
IP address instances already are immutable and flyweight. There are no mutating methods. And a number of address attributes (packed, is_loopback, etc) are calculated on fly from integer representation.
But IP address objects can be lighter.
1) Use __slots__.
2) Every instance has the _version attribute. Why this is not class attribute?
3) Memory consumption can be even less if IP addresses would int subclasses. But this changes the API (in particular adds the __index__ method) and I doubt that we should do this. |
|
Date |
User |
Action |
Args |
2014-12-23 14:50:59 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ncoghlan, pmoody, josh.r, sbromberger |
2014-12-23 14:50:59 | serhiy.storchaka | set | messageid: <1419346259.93.0.833989186719.issue23103@psf.upfronthosting.co.za> |
2014-12-23 14:50:59 | serhiy.storchaka | link | issue23103 messages |
2014-12-23 14:50:59 | serhiy.storchaka | create | |
|