Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
27396a18
Commit
27396a18
authored
Jul 08, 2012
by
Nick Coghlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 14814: Remove dead function (noticed by Serhiy Storchaka)
parent
6803855e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
19 deletions
+0
-19
Lib/ipaddress.py
Lib/ipaddress.py
+0
-18
Lib/test/test_ipaddress.py
Lib/test/test_ipaddress.py
+0
-1
No files found.
Lib/ipaddress.py
View file @
27396a18
...
...
@@ -183,24 +183,6 @@ def _find_address_range(addresses):
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.
...
...
Lib/test/test_ipaddress.py
View file @
27396a18
...
...
@@ -551,7 +551,6 @@ class IpaddrUnitTest(unittest.TestCase):
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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment