#!/usr/bin/python class myrec: file = '' line = '' fnccall = '' def __init__(self, file, line, fnccall): self.file = file self.line = line self.fnccall = fnccall def find(self, str): return self.fnccall.find(str) def __str__(self): return self.fnccall def __repr__(self): return self.fnccall test = ['a', 'b', 'c', 'a', 'b', 'd'] fnccalls = [] for t in test: if fnccalls.count(t) == 0: fnccalls.append(myrec('myfile', '10', t)) print fnccalls