def _GetOpList(): """Returns list of all defined opcodes. Does not eliminate duplicates by C{OP_ID}. """ return [v for v in globals().values() if (isinstance(v, type) and issubclass(v, OpCode) and hasattr(v, "OP_ID") and v is not OpCode and v.OP_ID != 'OP_INSTANCE_MULTI_ALLOC_BASE')] OP_MAPPING = dict((v.OP_ID, v) for v in _GetOpList())