metaclass py2 to py3 compat