summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-05-26 15:03:25 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-05-26 15:03:25 (GMT)
commit2c58910d3dd8d13622f774e53c28b6de8b36a920 (patch)
tree67786c56c1de784b4c48ce272ba55d386f403154
parentaff73f91cce05f08f0654698008012359c17f87b (diff)
downloadcpython-2c58910d3dd8d13622f774e53c28b6de8b36a920.zip
cpython-2c58910d3dd8d13622f774e53c28b6de8b36a920.tar.gz
cpython-2c58910d3dd8d13622f774e53c28b6de8b36a920.tar.bz2
Issue #14814: Clean out an obsolete property and method from ipaddress Network objects
-rw-r--r--Lib/ipaddress.py14
-rw-r--r--Lib/test/test_ipaddress.py2
2 files changed, 2 insertions, 14 deletions
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index 1d72bbc..cb35685 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -710,12 +710,6 @@ class _BaseNetwork(_IPAddressBase):
return x
@property
- def network(self):
- # XXX (ncoghlan): This is redundant now and will likely be removed
- return self.__class__('%s/%d' % (str(self.network_address),
- self.prefixlen))
-
- @property
def with_prefixlen(self):
return '%s/%d' % (str(self.ip), self._prefixlen)
@@ -942,12 +936,6 @@ class _BaseNetwork(_IPAddressBase):
yield current
- def masked(self):
- """Return the network object with the host bits masked out."""
- # XXX (ncoghlan): This is redundant now and will likely be removed
- return self.__class__('%s/%d' % (self.network_address,
- self._prefixlen))
-
def supernet(self, prefixlen_diff=1, new_prefix=None):
"""The supernet containing the current network.
@@ -1908,7 +1896,7 @@ class _BaseV6(object):
"""
if isinstance(self, IPv6Network):
- return int(self.network) == 1 and getattr(
+ return int(self) == 1 and getattr(
self, '_prefixlen', 128) == 128
elif isinstance(self, IPv6Interface):
return int(self.network.network_address) == 1 and getattr(
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py
index 5c89681..fd6c38c 100644
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -390,7 +390,7 @@ class IpaddrUnitTest(unittest.TestCase):
self.assertRaises(ValueError, list,
self.ipv4_interface.network.subnets(-1))
self.assertRaises(ValueError, list,
- self.ipv4_network.network.subnets(-1))
+ self.ipv4_network.subnets(-1))
self.assertRaises(ValueError, list,
self.ipv6_interface.network.subnets(-1))
self.assertRaises(ValueError, list,