1、

Instance attribute course defined outside __init__ less... (Ctrl+F1)
This inspection detects instance attribute definition outside __init__ method
实例属性课程定义在……(Ctrl + F1)这个检查在_init__方法之外检测实例属性定义
- class Class:
# 班级和学校的关联,在学校里关联班级了就没有必要再班级内关联学校
def __init__(self,name,course):
self.name = name
self.course = None # 加入改熟悉,由原来新增值的操作改成了修改值的操作
def related_course(self,course_name):
self.course = course_name
# 该处的黄线表示:实例属性课程定义在……(Ctrl + F1)这个检查在_init__方法之外检测实例属性定义
Python中遇到的难解的提示:
原文:https://www.cnblogs.com/liunaixu/p/12824351.html