'''Параметры метакласса'''

'''Шаблон для создания метакласса'''
class NewMetaclass(type):
    def __new__(mcls, name, bases, cls_dict):
        return super().__new__(mcls, name, bases, cls_dict)
    
class MyClass(metaclass=NewMetaclass):
    pass


'''Дополнительные аргументы'''
class Metaclass(type):
    def __new__(cls, name, bases, cls_dict, arg1, arg2, arg3=None):
        print('Запуск создания нового типа данных', arg1, arg2, arg3)        
        return super().__new__(cls, name, bases, cls_dict)
    
class MyClass1(metaclass=Metaclass, arg1=10, arg2=20, arg3=30):
    pass

class MyClass2(metaclass=Metaclass, arg1=10, arg2=5):
    pass


'''Передача коллекции атрибутов'''
class AutoClassAttrib(type):
    def __new__(cls, name, bases, cls_dict, extra_attrs=None):
        new_cls = super().__new__(cls, name, bases, cls_dict)
        if extra_attrs:
            print('Creating class with some extra attributes: ', extra_attrs)
            for attr_name, attr_value in extra_attrs:
                setattr(new_cls, attr_name, attr_value)
        return new_cls
    
class Account(metaclass=AutoClassAttrib,
              extra_attrs=[
                  ('account_type', 'debit'),
                  ('city', 'Paris'),
                  ('overdraft', 1000)]
            ):
    pass


def test_1():
    print(Account.__dict__)
    print('-' * 15)

    class Person(object, metaclass=AutoClassAttrib,
                 extra_attrs=[
                     ('country', 'Tailand'),
                     ('citizen', True)
                 ]):
        def __init__(self, name, age):
            self.name = name
            self.age = age

    print(Person.__dict__)

def main():
    test_1()


if __name__ == '__main__':
    main()