Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3389)

Unified Diff: Lib/ipaddress.py

Issue 14814: Implement PEP 3144 (the ipaddress module)
Patch Set: Created 11 months, 3 weeks ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -1990,10 +1990,6 @@
self.network_address = IPv6Address(address)
self._prefixlen = self._max_prefixlen
self.netmask = IPv6Address(self._ALL_ONES)
- if strict:
- if (IPv6Address(int(self.network_address) &
- int(self.netmask)) != self.network_address):
- raise ValueError('%s has host bits set' % str(self))
self.network_address = IPv6Address(int(self.network_address) &
int(self.netmask))
Nick Coghlan 2012/06/08 14:50:18 The second assignment of network_address can go aw
return
@@ -2004,13 +2000,9 @@
self.network_address = IPv6Address((tmp[0] << 64) | tmp[1])
self._prefixlen = self._max_prefixlen
self.netmask = IPv6Address(self._ALL_ONES)
- if strict:
- if (IPv6Address(int(self.network_address) &
- int(self.netmask)) != self.network_address):
- raise ValueError('%s has host bits set' % str(self))
- self.network_address = IPv6Address(int(self.network_address) &
- int(self.netmask))
- return
+ self.network_address = IPv6Address(int(self.network_address) &
Nick Coghlan 2012/06/08 14:50:18 As above - with the netmask set to all ones, no ne
+ int(self.netmask))
+ return
# Assume input argument to be string or any object representation
# which converts into a formatted IP prefix string.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7