COMPSCI 61A Lecture Notes - Lecture 25: Stack Trace, Exception Handling

23 views4 pages
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

Function receives argument value of an improper type. Network connection is lost in the middle of data transmission. Lots of cases where the computer can have errors, handle them. Python interpreter stops immediately when an error arises. Have to think about how errors are handled. Built -in mechanisms in a progamming language to declare and respond to exceptional conditions. Python raises an exception whenever an error occurs. Exceptions can be handled by the program, preventing the interpreter from halting. Unhandled exceptions will cause python to halt execution and print a stack trace. Exceptions are objects, have classes with constructors. If f calls g and g calls h, exceptions can shift control from h to f without waiting for g to return. Bypass g, return to dfiferent case, raise an exception and handle it. Assertions are designed to be used liberally,they can be ignored to increase efficiency by. Raising exceptions: running python witht he -o flag, stands for optimized.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents