'Explode IPv6 address for comparison'

def _explode_ipv6(self, addr):

    result = ['0', '0', '0', '0', '0', '0', '0', '0']
    addr_list = addr.split(':')
    if (len(addr_list) > len(result)):
        addr_list = addr_list[0:len(result)]
    append_to_end = False
    for i in range(0, len(addr_list)):
        block = addr_list[i]
        if (len(block) == 0):
            append_to_end = True
            continue
        elif (len(block) > 1):
            block = block.lstrip('0')
        if (not append_to_end):
            result[i] = str(block)
        else:
            result[(i - len(addr_list))] = str(block)
    return result
