What is the relationship between Errors, Exceptions and Interrupts in Python 3? -


in python 3 there many types of exception. exception names end "error" (for example, standarderror, overflowerror). other exceptions not end in error (eg. keyboardinterrupt, systemexit).

are errors derived class exception? exceptions interrupt program execution?

is inheritance tree accurate?

errors -> exceptions -> interrupt

docs:

exception: built-in, non-system-exiting exceptions derived class. user-defined exceptions should derived class.

so, systemexit , keyboardinterrupt meant terminate program (and don't expect except exception catch them; if want catch them, need more specific); generatorexit explained in docs itself.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -