Then how can we destroy the 3rd instance,
right after its creation and from inside
class Moo code?

class Moo:
    cnt = 0
    def __init__(self, x):
        self.x = x
        self.__class__.cnt += 1
        if self.__class__.cnt > 2:
            print id(self)
            ## 13406816
            ## in what dict is this ID?
            ## and can we delete it from there?

            ## ???


f = Moo(1)
g = Moo(2)
h = Moo(3)
print h

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to