[Python-checkins] cpython: Issue 14814: Remove dead function (noticed by Serhiy Storchaka)
nick.coghlan
python-checkins at python.org
Sun Jul 8 13:38:24 CEST 2012
http://hg.python.org/cpython/rev/45265ecaa3e4
changeset: 78001:45265ecaa3e4
user: Nick Coghlan <ncoghlan at gmail.com>
date: Sun Jul 08 21:38:12 2012 +1000
summary:
Issue 14814: Remove dead function (noticed by Serhiy Storchaka)
files:
Lib/ipaddress.py | 18 ------------------
Lib/test/test_ipaddress.py | 1 -
2 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -183,24 +183,6 @@
return (first, last)
-def _get_prefix_length(number1, number2, bits):
- """Get the number of leading bits that are same for two numbers.
-
- Args:
- number1: an integer.
- number2: another integer.
- bits: the maximum number of bits to compare.
-
- Returns:
- The number of leading bits that are the same for two numbers.
-
- """
- for i in range(bits):
- if number1 >> i == number2 >> i:
- return bits - i
- return 0
-
-
def _count_righthand_zero_bits(number, bits):
"""Count the number of zero bits on the right hand side.
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
@@ -551,7 +551,6 @@
ipaddress.IPv4Address('10.10.10.10'),
ipaddress.IPv4Address('10.10.10.12')])
self.assertEqual(first, last)
- self.assertEqual(0, ipaddress._get_prefix_length(2**32, 0, 32))
self.assertEqual(128, ipaddress._count_righthand_zero_bits(0, 128))
self.assertEqual("IPv4Network('1.2.3.0/24')", repr(self.ipv4_network))
self.assertEqual('0x1020318', hex(self.ipv4_network))
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list