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 sbromberger
Recipients josh.r, ncoghlan, pmoody, r.david.murray, sbromberger, serhiy.storchaka
Date 2014-12-23.16:29:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419352197.47.0.223627339081.issue23103@psf.upfronthosting.co.za>
In-reply-to
Content
1) However:

>>> b = ipaddress.IPv4Address('1.2.3.4')
>>> a = ipaddress.IPv4Address('1.2.3.4')
>>> id(a)
4428380928
>>> id(b)
4428381768
>>> a == b
True
>>> b._ip += 6
>>> id(b)
4428381768
>>> b
IPv4Address('1.2.3.10')


2) Isn’t _version already a class attribute? It’s set in _Basev4/Basev6.

3) Memory consumption seems particularly wasteful in the current implementation: it takes 56 bytes (via sys.getsizeof) to store what amounts to 4 bytes of data.

I thought about subclassing Int as well, and I agree it’s the wrong approach. There are too many int methods that don’t make sense in the context of IP addresses.
History
Date User Action Args
2014-12-23 16:29:57sbrombergersetrecipients: + sbromberger, ncoghlan, pmoody, r.david.murray, serhiy.storchaka, josh.r
2014-12-23 16:29:57sbrombergersetmessageid: <1419352197.47.0.223627339081.issue23103@psf.upfronthosting.co.za>
2014-12-23 16:29:57sbrombergerlinkissue23103 messages
2014-12-23 16:29:57sbrombergercreate