First and foremost, this is a backwards incompatible change. Code written for ipaddr-1.x will likely not work stock with ipaddr-2.0. For users of the 1.x branch, I'll continue to provide support, but new-feature development has ceased. But it's not so bad, take a look.All in all, I think this new version of ipaddr is much more intuitive and easy to use.
The best way to get a feel for this code is to download it and try and out, but I've tried to list some of the more important changes below to help you out.
The major changes.
IPvXAddress and IPvXNetwork classes.
* Individual addresses are now (IPv4|IPv6)Address objects. Network attributes that are actually addresses (eg, broadcast, network, hostmask) are now (IPv4|IPv6)Address objects. That means no more IPv4/IPv6 classes handling only networks.
{{{
In [3]: ipaddr.IPv4Network("1.1.1.0/24")
Out[3]: IPv4Network('1.1.1.0/24')
In [4]: ipaddr.IPv4Network("1.1.1.0/24").network
Out[4]: IPv4Address('1.1.1.0')
In [5]: ipaddr.IPv4Network("1.1.1.0/24").broadcast
Out[5]: IPv4Address('1.1.1.255')
}}}
* no more ext methods. To reference the stringified version of any attribute, you call str() on (similar for the numeric value with int()).
{{{
In [6]: str(ipaddr.IPv4Network("1.1.1.0/24").broadcast)