为什么pycharm在此代码的类或函数之外为None
发出“预期类型”警告:
def blah():
hiya = None # type: dict # No type warning
class Foo:
bar = None # type: dict # No type warning
asf = None # type: dict # Expected type 'dict', got 'None' instead
答案 0 :(得分:0)
我正在使用Pycharm,对我来说这很好
def blah():
hiya = None # type: #dict # No type warning
class Foo:
bar = None # type: #dict # No type warning
asf = None # type: #dict # Expected type 'dict', got 'None' instead
也许是您设置中的内容。