]> granicus.if.org Git - python/commitdiff
Issue #14814: Clean out an obsolete property and method from ipaddress Network objects
authorNick Coghlan <ncoghlan@gmail.com>
Sat, 26 May 2012 15:03:25 +0000 (01:03 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Sat, 26 May 2012 15:03:25 +0000 (01:03 +1000)
Lib/ipaddress.py
Lib/test/test_ipaddress.py

index 1d72bbc91c612c103d8dfb6fb7e5af9c9ed5c1bf..cb35685925c2cff075a1110b727078e74c4eeea3 100644 (file)
@@ -709,12 +709,6 @@ class _BaseNetwork(_IPAddressBase):
             self._cache['hostmask'] = x
         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(
index 5c89681ad06a3aa8e20124b475d25eb581edfaef..fd6c38c2bea50af84757f95c2e520e4ef865bec6 100644 (file)
@@ -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,