class C:
footprints = set()
def __init__(self, fp):
if fp in self.footprints:
raise KeyError("object C with footprint %r already exists" % fp)
self.footprint = fp
self.footprints.add(fp)
def __repr__(self):
return "<C object with footprint %r>" % self.footprint
x = C("qwe")
y = C("rty")
print(x)
print(y)
z = C("qwe")