def __init_subclass__(cls, class_id, method_id, response_to=None,
followed_by_content=False, closing=False, **kwargs):
super().__init_subclass__(**kwargs)
cls.struct = make_struct(cls)
cls.closing = closing
cls.followed_by_content = followed_by_content
if followed_by_content:
cls.content = attr.ib(default=None)
cls.responses = []
cls.response_to = response_to
if response_to is not None:
response_to.responses.append(cls)
cls.class_id = attr.ib(default=class_id, init=False)
cls.method_id = attr.ib(default=method_id, init=False)
cls.channel_id = attr.ib(default=None, init=False)
cls.BY_ID[(class_id, method_id)] = cls
评论列表
文章目录