[issue23103] ipaddress should be Flyweight
Seth Bromberger
report at bugs.python.org
Tue Dec 23 10:57:26 CET 2014
New submission from Seth Bromberger:
ipaddress.ip_address instances should be flyweight. There's really no reason to make them mutable:
>>> a = ipaddress.ip_address("10.1.2.3")
>>> b = ipaddress.ip_address("10.1.2.3")
>>> id(a)
140066533772368
>>> id(b)
140066504622544
Especially with IPv6 and large numbers of addresses, it would be helpful not to have separate instances with the same underlying properties.
----------
components: Library (Lib)
messages: 233038
nosy: Seth.Bromberger
priority: normal
severity: normal
status: open
title: ipaddress should be Flyweight
type: enhancement
versions: Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23103>
_______________________________________
More information about the Python-bugs-list
mailing list