[Python-checkins] cpython: Issue #14814: Clean out an obsolete property and method from ipaddress Network

nick.coghlan python-checkins at python.org
Sat May 26 17:03:41 CEST 2012


http://hg.python.org/cpython/rev/0b54721bf1cc
changeset: 77162:0b54721bf1cc
user: Nick Coghlan <ncoghlan at gmail.com>
date: Sun May 27 01:03:25 2012 +1000
summary:
 Issue #14814: Clean out an obsolete property and method from ipaddress Network objects
files:
 Lib/ipaddress.py | 14 +-------------
 Lib/test/test_ipaddress.py | 2 +-
 2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -710,12 +710,6 @@
 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 @@
 
 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 @@
 
 """
 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
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -390,7 +390,7 @@
 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,
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /