Fix: replace notimplemented by NotImplementedError

This commit is contained in:
Bertrand Benjamin 2019-07-15 17:16:00 +02:00
parent d45ab560c9
commit 6e24756746

View File

@ -55,11 +55,11 @@ class Polynomial(Token):
@classmethod @classmethod
def random(cls): def random(cls):
raise NotImplemented raise NotImplementedError
def __setitem__(self, key, item): def __setitem__(self, key, item):
""" Use Polynomial like if they were a dictionnary to set coefficients """ """ Use Polynomial like if they were a dictionnary to set coefficients """
raise NotImplemented("Can't set coefficient of a polynomial") raise NotImplementedError("Can't set coefficient of a polynomial")
def __getitem__(self, key): def __getitem__(self, key):
""" Use Polynomial like if they were a dictionnary to get coefficients """ Use Polynomial like if they were a dictionnary to get coefficients
@ -104,7 +104,7 @@ class Polynomial(Token):
@property @property
def roots(self): def roots(self):
""" Get roots of the Polynomial """ """ Get roots of the Polynomial """
raise NotImplemented("Can't compute roots not specific polynomial") raise NotImplementedError("Can't compute roots not specific polynomial")
class Linear(Polynomial): class Linear(Polynomial):
@ -142,7 +142,7 @@ class Linear(Polynomial):
@classmethod @classmethod
def random(cls): def random(cls):
raise NotImplemented raise NotImplementedError
@property @property
def a(self): def a(self):
@ -213,7 +213,7 @@ class Quadratic(Polynomial):
@classmethod @classmethod
def random(cls): def random(cls):
raise NotImplemented raise NotImplementedError
@property @property
def a(self): def a(self):
@ -238,7 +238,7 @@ class Quadratic(Polynomial):
elif self.delta._mo == 0: elif self.delta._mo == 0:
return [Expression.from_str(f"-{self.b}/(2*{self.a})").simplify()] return [Expression.from_str(f"-{self.b}/(2*{self.a})").simplify()]
else: else:
raise NotImplemented("Todo!") raise NotImplementedError("Todo!")