Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "NotImplementedError"

Tags:

python

package

I was working with some packages. I need to install "base". But when I install it it says:

NotImplementedError: decoding with 'cp1252' codec failed (NotImplementedError: )

I don't understand the meaning of this. Can anyone please help me?

like image 799
coder Avatar asked Jul 31 '26 07:07

coder


1 Answers

In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs to be added.

lets say I have Base class and which has foo method, this method will raise NotImplementedError error if we directly call it on Base.

class Base:
    @property
    def foo(self):
        raise NotImplementedError("Subclasses should implement this!")

foo method needs to be implemented in derived class

like image 72
Sanjay Avatar answered Aug 02 '26 19:08

Sanjay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!