Indicating Unimplemented Features with NotImplementedError
NotImplementedError
is an exception used to indicate that a certain feature has not been implemented yet.
It is primarily used during the development process to mark functionalities that will be implemented later.
Example Usage of NotImplementedError
number = 11 if number > 10: raise NotImplementedError("Handling for numbers greater than 10 is not yet implemented") else: print("The number is 10 or less.")
In the code example above, if the variable number
exceeds 10
, a NotImplementedError
is raised.
At this time, the message of the NotImplementedError
indicates "Handling for numbers greater than 10 is not yet implemented".
Similar to the pass
keyword previously introduced, it is used to mark functions that will be implemented in the future, but NotImplementedError
is used to more explicitly convey the necessity of implementation.
Mission
0 / 1
NotImplementedError
does nothing when called.
O
X
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help
Code Editor
Run
Generate
Execution Result