summaryrefslogtreecommitdiffstats
path: root/Lib/ipaddress.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-08-05 08:20:17 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-08-05 08:20:17 (GMT)
commite0c3f5edc0f20cc28363258df501758c1bdb1ca7 (patch)
tree641a52e5a0df70f91db0d7057e6680d1f286f662 /Lib/ipaddress.py
parent37d3ff14871a25429fb93167aeace0589be45426 (diff)
downloadcpython-e0c3f5edc0f20cc28363258df501758c1bdb1ca7.zip
cpython-e0c3f5edc0f20cc28363258df501758c1bdb1ca7.tar.gz
cpython-e0c3f5edc0f20cc28363258df501758c1bdb1ca7.tar.bz2
Close #15559: Implementing __index__ creates a nasty interaction with the bytes constructor. At least for 3.3, ipaddress objects must now be explicitly converted with int() and thus can't be passed directly to the hex() builtin.
Diffstat (limited to 'Lib/ipaddress.py')
-rw-r--r--Lib/ipaddress.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index c6eea7f..612236e 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -511,9 +511,6 @@ class _BaseAddress(_IPAddressBase):
and '/' in str(address)):
raise AddressValueError("Unexpected '/' in %r" % address)
- def __index__(self):
- return self._ip
-
def __int__(self):
return self._ip
@@ -571,9 +568,6 @@ class _BaseNetwork(_IPAddressBase):
def __init__(self, address):
self._cache = {}
- def __index__(self):
- return int(self.network_address) ^ self.prefixlen
-
def __int__(self):
return int(self.network_address)