What is the Python equivalent for Java UnsupportedOperationException?

I look at Python's built-in exceptions and wonder what the closest equivalent to Java is UnsupportedOperationException. NotImplementedErrorclose but seems to offer something a little different. Should I use RuntimeErroror implement my own Exception?

+4
source share
2 answers

The closest equivalent is simply not to implement an unsupported method. Outgoing exception, if you try to use a non-existent method, this AttributeError.

+7
source

Java, , , ( ), , . .

, , TypeError. , - , ValueError. , 2357112, AttributeError .

+1

All Articles