Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
generic software skills
lecture materials
Commits
63afc856
Commit
63afc856
authored
11 months ago
by
Dominik Zobel
Browse files
Options
Downloads
Patches
Plain Diff
Move Python error messages on the same slide with code
parent
a3066370
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
Debugging Strategies lecture notes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lectures/debugging-strategies/slides.qmd
+25
-17
25 additions, 17 deletions
lectures/debugging-strategies/slides.qmd
with
25 additions
and
17 deletions
lectures/debugging-strategies/slides.qmd
+
25
−
17
View file @
63afc856
...
...
@@ -101,7 +101,7 @@ int main() {
:::
:::{.column width=50%}
:::{.column width=50%
.fragment
}
- Compilation only throws a warning
```
...
...
@@ -127,7 +127,11 @@ Aborted
::::::::
## Locating the right error message (1/2) {.leftalign}
## Locating the right error message {.leftalign}
::::::::{.columns .smaller}
:::{.column width=50%}
```python
def _extend_number(num):
...
...
@@ -145,35 +149,35 @@ def extend_number(num):
print(extend_number('6'))
```
:::{.smaller}
Expected output:
:::
```
6543210
```
:::
## Locating the right error message (2/2)
:::{.column width=50% .fragment}
Output from previous code (last 15 lines)
```
During handling of the above exception, another exception occurred:
Actual output (last 17 lines)
```
Traceback (most recent call last):
File "<stdin>", line 3, in extend_number
File "number_extension.py", line 6, in extend_number
for idx in range(num):
RecursionError: maximum recursion depth exceeded while calling a Python object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 6, in extend_number
File "<stdin>", line 6, in extend_number
File "<stdin>", line 6, in extend_number
File "number_extension.py", line 13, in <module>
print(extend_number('6'))
File "number_extension.py", line 9, in extend_number
num = extend_number(num)
File "number_extension.py", line 9, in extend_number
num = extend_number(num)
File "number_extension.py", line 9, in extend_number
num = extend_number(num)
[Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceeded
```
...
...
@@ -182,10 +186,14 @@ RecursionError: maximum recursion depth exceeded
issues in line 9 and 13
-->
:::
::::::::
## Hands-On! {.handson}
1. What are the actual issues in the code from the previous slide
s
based on the error messages?
1. What are the actual issues in the code from the previous slide based on the error messages?
2. How to rectify them?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment