py2 to py3 metaclass compat