human
I am working on the file "2020/2020-02-29/MetaProgramming In Python.ipynb".
The first task is:
LifeCycle with Metaclasses
Can you write Python program for it?
 ... Give me a the Python program you requested?
assistant
#Here is the Python program you requested.

class MyMetaClass(type):
    
    _test_attribute = 1

    def __new__(cls, *args, **kwargs):
        print("metaclass new method called")
        return super(MyMetaClass, cls).__new__(cls, *args, **kwargs)
    
    def __call__(cls, *args, **kwargs):
        print("metaclass call method called")
        return super(MyMetaClass, cls).__call__(*args, **kwargs)

    def __init__(self, *args, **kwargs):
        print("metaclass init method called")
        return super(MyMetaClass, self).__init__(*args, **kwargs)
    
    def test_method_1(self):
        print("MyMetaClass - Test method 1 called")

class MyClass(metaclass=MyMetaClass):
    def __new__(cls, *args, **kwargs):
        print("instance new method called")
        return super(MyClass, cls).__new__(cls, *args, **kwargs)
    
    def __init__(self, *args, **kwargs):
        print("instance init method called")
        return super(MyClass, self).__init__(*args, **kwargs)

ins2 = MyClass()

MyClass._test_attribute

MyClass.__mro__

MyMetaClass.__mro__