Metaclass support for Python2 and Python3