@property
def port(self):
    components = self.netloc.split(':')
    try:
        return int(components[1])
    except (IndexError, ValueError):
        pass
    if (self.scheme == 'https'):
        return 443
    if (self.scheme == 'http'):
        return 80
    return 0
@property
def port(self):
    components = self.netloc.split(':')
    try:
        return int(components[1])
    except (IndexError, ValueError):
        pass
    if (self.scheme == 'https'):
        return 443
    if (self.scheme == 'http'):
        return 80
    return 0