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
2c58910d
Commit
2c58910d
authored
May 27, 2012
by
Nick Coghlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #14814: Clean out an obsolete property and method from ipaddress Network objects
parent
aff73f91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
14 deletions
+2
-14
Lib/ipaddress.py
Lib/ipaddress.py
+1
-13
Lib/test/test_ipaddress.py
Lib/test/test_ipaddress.py
+1
-1
No files found.
Lib/ipaddress.py
View file @
2c58910d
...
...
@@ -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
(
...
...
Lib/test/test_ipaddress.py
View file @
2c58910d
...
...
@@ -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
,
...
...
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