human
I am working on the file "2020/2020-02-29/MetaProgramming In Python.ipynb".
The first task is:
Pattern 5 : Sealed classes
Can you write Python code for it?

What is a the Python code you requested?
assistant
#Here is the Python code you requested.

class MySealedMeta(type):
    
    def __new__(cls, name, bases, attrs):
        all_metaclasses = [type(x) for x in bases]
        if MySealedMeta in all_metaclasses:
            raise TypeError("Sealed class cannot be sublcassed")
        return super(MySealedMeta, cls).__new__(cls, name, bases, attrs)
    

class MySealedClass(metaclass=MySealedMeta):
    pass

class MyChildOfSealed(MySealedClass):
    pass