Python 3: notImplementedError "undefined name" 警告
Python 3: notImplementedError "undefined name" warning
我在摘要 class 中的 spyder 代码分析中收到警告 "undefined name notImplemented error",如下所示:
class Shape: # define parent class
parametersList = []
def __init__(self,parametersList,color):
self.parametersList=parametersList
self.color=color
def print_color(self):
# Prints object color
raise notImplementedError
def eval_area(self):
# Evals area
raise notImplementedError
发生了什么事?
首先,尝试大写 "NotImplementedError"。如果情况并非如此,那么我相信来自 Semmle 的 this thread 可能会给您带来其他情况的线索。
我在摘要 class 中的 spyder 代码分析中收到警告 "undefined name notImplemented error",如下所示:
class Shape: # define parent class
parametersList = []
def __init__(self,parametersList,color):
self.parametersList=parametersList
self.color=color
def print_color(self):
# Prints object color
raise notImplementedError
def eval_area(self):
# Evals area
raise notImplementedError
发生了什么事?
首先,尝试大写 "NotImplementedError"。如果情况并非如此,那么我相信来自 Semmle 的 this thread 可能会给您带来其他情况的线索。