class myClass(object): # This class called myClass is inheriting the object class
    count=0
    def __init__(self):
        type(self).count+=1
    def __del__(self):
        type(self).count-=1
    def regMethod(self,myMessage):
        self.message = myMessage
        print("Hello ",self.message)

myObj = myClass()
print("Number of instances of the MyClass objects are :",myObj.count)
myObj2 = myClass()
print("Number of instances of the MyClass objects are :",myObj.count)

del myObj # deleting an object
print("Number of instances of the MyClass objects are :",myObj2.count)
myObj2.regMethod("Test")
1bb286da454c03e31e8cdd9dee8bb140196a66e3
class myClass(object):
    <mask token>
    <mask token>

    def __del__(self):
        type(self).count -= 1

    def regMethod(self, myMessage):
        self.message = myMessage
        print('Hello ', self.message)


<mask token>

class myClass(object):
    <mask token>

    def __init__(self):
        type(self).count += 1

    def __del__(self):
        type(self).count -= 1

    def regMethod(self, myMessage):
        self.message = myMessage
        print('Hello ', self.message)


<mask token>

class myClass(object):
    count = 0

    def __init__(self):
        type(self).count += 1

    def __del__(self):
        type(self).count -= 1

    def regMethod(self, myMessage):
        self.message = myMessage
        print('Hello ', self.message)


<mask token>
print('Number of instances of the MyClass objects are :', myObj.count)
<mask token>
print('Number of instances of the MyClass objects are :', myObj.count)
del myObj
print('Number of instances of the MyClass objects are :', myObj2.count)
myObj2.regMethod('Test')

class myClass(object):
    count = 0

    def __init__(self):
        type(self).count += 1

    def __del__(self):
        type(self).count -= 1

    def regMethod(self, myMessage):
        self.message = myMessage
        print('Hello ', self.message)


myObj = myClass()
print('Number of instances of the MyClass objects are :', myObj.count)
myObj2 = myClass()
print('Number of instances of the MyClass objects are :', myObj.count)
del myObj
print('Number of instances of the MyClass objects are :', myObj2.count)
myObj2.regMethod('Test')

class myClass(object): # This class called myClass is inheriting the object class
    count=0
    def __init__(self):
        type(self).count+=1
    def __del__(self):
        type(self).count-=1
    def regMethod(self,myMessage):
        self.message = myMessage
        print("Hello ",self.message)

myObj = myClass()
print("Number of instances of the MyClass objects are :",myObj.count)
myObj2 = myClass()
print("Number of instances of the MyClass objects are :",myObj.count)

del myObj # deleting an object
print("Number of instances of the MyClass objects are :",myObj2.count)
myObj2.regMethod("Test")