2017-10-05 90 views
1

我有这样一段代码一个Python模块中PyCharm社区版2017.2开放在不确定的变量,没有警告。在PyCharm社区2017.2

class Sample(object): 
    def __init__(self): 
     self.prop1 = 5 
     self.prop2 = 10 

    def method1(self): 
     return foo 

    def do_work(self): 
     not_defined_func() 


s = Sample() 
s.method1() 

bar = call_func 

IDE不会给出一些比较严重的问题,任何警告:

  1. 返回的变量foo尚未确定。
  2. 我分配没有定义的变量call_func到可变bar
  3. 我呼叫没有定义函数not_defined_func方法do_work内部。

如何使PyCharm突出这些东西?我有一个全新的PyCharm安装,并且在File > Settings > Editor > Inspections > Python中启用了所有Inspections。其中Python解释器被启用转到偏好>项目>项目翻译

回答

0

见。设置python解释器,然后应用它。 同时检查是否启用检查。