Skip to content

Commit 56d1ac9

Browse files
committed
version stepping of dependencies and first steps into exceptions
1 parent 08bf138 commit 56d1ac9

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# You can find it at https://thomasweise.github.io/latexgit_py,
77
# https://github.com/thomasWeise/latexgit_py, or at
88
# https://pypi.org/project/latexgit.
9-
latexgit == 0.8.22
9+
latexgit == 0.8.23
1010

1111
# minify_html is needed to minify html output.
1212
minify_html == 0.15.0

text/main/controlFlow/controlFlow.tex

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
\hinput{conditionals}{conditionals.tex}%
1717
\hinput{loops}{loops.tex}%
1818
\hinput{functions}{functions.tex}%
19+
\hinput{exceptions}{exceptions.tex}%
1920
%
2021
\endhsection%
2122
%
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
\hsection{Exceptions}%
2+
%
3+
So far, we have mainly focused on writing correct code.
4+
Code that is free of errors.
5+
At some points, however, we have come into contact with errors that may arise regardless of whether our code is correct or not.
6+
Back in \cref{sec:float:special}, we saw that trying to compute something like \pythonil{(10 ** 400) * 1.0} will yield an \pythonilIdx{OverflowError}, as the integer~$10^{400}$ is too large to convert it to a \pythonil{float} during the multiplication with~\pythonil{1.0}.
7+
Trying to access a character of a string at an index greater than or equal to the length of the string will lead to an~\pythonilIdx{IndexError}, as we saw in \cref{sec:strBasicOperations}.
8+
The attempt to modify an element of a \pythonil{tuple} is rewarded with a \pythonilIdx{TypeError} in \cref{sec:tuples}.
9+
Clearly, some of these errors may result from programming mistakes.
10+
But they could just as well result from invalid data being entered in the input of the program.
11+
%
12+
\endhsection%
13+
%

text/main/controlFlow/functions/functions.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@
600600
\FloatBarrier%
601601
\endhsection%
602602
%
603-
\hsection{Functions as Parameters or Variables, \texttt{Callable} and \texttt{lambda}s}%
603+
\hsection{Functions as Parameters or Variables, \texttt{Callable}, and \texttt{lambda}s}%
604604
%
605605
We have just learned that we can basically construct a function call by placing the parameter values into collection objects and then invoke the function by \inQuotes{unpacking} the collection using either \pythonil{*} (for position-based parameters) or \pythonil{**} (for dictionaries).
606606
But there is one more interesting thing that we can do with functions.

0 commit comments

Comments
 (0)