RuntimeError

A general built-in exception for errors that fit no more specific category.

In more detail

Prefer a more precise exception, such as ValueError or a custom exception class, when one fits; RuntimeError is the last resort. Python itself raises it in a few situations, such as a dictionary changing size while a loop is going through it.

Related terms

Taught in

References

Certification courses