English subtitles

← Assertions in Python - Software Debugging

Get Embed Code
4 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. Welcome back. What's the answer to this? Well, very simple--we go and try this out.
  2. Here's a failing assertion: 2+2=5. Let's see, when we run this whole thing what we got?
  3. So here's the anti-traceback: we get the assertion error, we get the assertion that failed.
  4. At least we get the line and the code, which is the same.
  5. We get the location--line 1 in our function and we get the list of callers.
  6. So we've seen the list of callers, the location of the assertion of the program,
  7. and the failing assertion itself.
  8. What we do not get is the location of the defect in the code because the defect would actually
  9. causes the infection that later causes the assertion to fail, maybe in a completely different location.
  10. That's the whole point of debugging, trying to find the defect that causes an assertion to fail.
  11. However, during this course, you will find techniques that help you a lot in finding out
  12. where the defect is that causes an assertion to fail and all of these automatically.