flake8_builtins.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:flake8-builtins 作者: gforcada 项目源码 文件源码
def check_assignment(self, statement):
        is_class_def = False
        if type(statement.__flake8_builtins_parent) is ast.ClassDef:
            is_class_def = True

        for element in statement.targets:
            if isinstance(element, ast.Name) and \
                    element.id in BUILTINS:

                line = element.lineno
                offset = element.col_offset
                if is_class_def:
                    msg = self.class_attribute_msg
                else:
                    msg = self.assign_msg
                yield (
                    line,
                    offset,
                    msg.format(element.id),
                    type(self),
                )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号