def new_type(name, *args, **kwargs):
    name = name.encode() if sys.version_info[0] == 2 else name
    return type(name, *args, **kwargs)
Alternative for type(...) to be legacy-py compatible.
dataset/ETHPy150Open zoofIO/flexx/flexx/react/hassignals.py/new_type