To reproduce the problem
>>> from ipaddr import IPv4Network, IPv4Address
>>> n = IPv4Network("192.168.1.134/24")
>>> n[0]
IPv4Address('192.168.1.0')
>>> n.ip = IPv4Address("10.10.1.34")
>>> n.ip
IPv4Address('10.10.1.34')
>>> n[0]
IPv4Address('192.168.1.0')
I would expect that after changing the ip of an IPv4Network instance the
network would also be updated. This behaviour is "somewhat" true when changing
the netmask.
As you can see from the example below:
>>> from ipaddr import IPv4Network, IPv4Address
>>> n = IPv4Network("192.168.34.45/24")
>>> n.netmask = IPv4Address("255.255.0.0")
>>> n[0]
IPv4Address('192.168.0.0')
When __getitem__ is used initially it returns the correct result. Any
subsequent call though produces faulty results
>>> n.netmask = IPv4Address("255.255.255.0")
>>> n[0]
IPv4Address('192.168.0.0')
Platform: Debian wheezy
Version: 2.1.10-1