2.2.11. 列表去重(去除重复的值):uniqueList

#------------------------------------------------------------------------------
# remove overlapped item in the list
def uniqueList(old_list):
    newList = []
    for x in old_list:
        if x not in newList :
            newList.append(x)
    return newList
        

例 2.15. uniqueList的使用范例

nonOverlapList = uniqueList(matchedList); # remove processed