Add scope on str

This commit is contained in:
Bo Maryniuk 2018-09-19 00:32:40 +02:00
parent f5644bf617
commit 66ec29ca75

View file

@ -178,6 +178,10 @@ class IPv6AddressScoped(ipaddress.IPv6Address):
'''
return self.__scope
def __str__(self):
return text_type(self._string_from_ip_int(self._ip) +
('%' + self.scope if self.scope is not None else ''))
def ip_address(address):
"""Take an IP string/int and return an object of the correct type.