Python 3.x Python 3:notImplementedError“;“未定义名称”;警告
我在下面的抽象类的spyder代码分析中得到了警告“undefined name notImplemented error”:Python 3.x Python 3:notImplementedError“;“未定义名称”;警告,python-3.x,abstract-class,notimplementedexception,Python 3.x,Abstract Class,Notimplementedexception,我在下面的抽象类的spyder代码分析中得到了警告“undefined name notImplemented error”: class Shape: # define parent class parametersList = [] def __init__(self,parametersList,color): self.parametersList=parametersList self.color=color def prin
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可能会给您提供有关情况的线索。存在语法错误。它是
NotImplementedError
而不是NotImplementedError
。顺便问一下,你用什么IDE?任何IDE都应该告诉您它是一个未知关键字。Anaconda中的Spyder。