Seth Bromberger added the comment:

>What is your proposal? WeakValueDictionary mapping raw bytes object to single 
>instance of ipaddress that is queried from ipaddress's __new__? No built-in 
>has quite that extensive a level of caching and aggressive deduplication to my 
>knowledge.

I was thinking along those lines, but since v4 addresses are just UInt32 and v6 
are UInt128, somehow mapping just the "address" information if we can do that 
via weakref dicts. Right now these objects can't really be used to represent 
addresses parsed from logs with tens of millions of entries generated by a 
couple thousand machines. It would be nice to have a memory-efficient way of 
doing that without having to duplicate the concept in a third-party package.

There are a few other changes I'd like to see/make as well - this package is 
too focused on external functions for manipulating/creating addresses, when 
standard object/method structure would serve it better and be more intuitive. 
There is also no discernible need to modify an IP address' value. They should 
be thought of as immutables to the extent we can enforce that policy.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23103>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to