from enum import Enum from collections import namedtuple ModuleItem = namedtuple('ModuleItem', ('id', 'name', 'rank', 'options')) class Module(Enum): USER = ModuleItem(1001, '用户管理', 1, {'下载': 1, '编辑': 9}) ROLE = ModuleItem(1002, '角色管理', 2, {}) TEMPLATE = ModuleItem(1003, '模板管理', 3, {})