Skip to content

Commit 1c6ba12

Browse files
committed
version stepping of dependencies and minor fixes
1 parent dc8255f commit 1c6ba12

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The list of files not under the CC BY‑NC‑SA 4.0 license bu
110110
+ The illustration of Euclid of Alexandria in "text/main/controlFlow/functions/euclidOfAlexandria" [attributed](https://www.antike-griechische.de/Euklid.pdf) to the painter Charles Paul Landon (1760-1826). Source:~[Vikidia](https://fr.vikidia.org/wiki/Cat%C3%A9gorie:Image_Euclide), where it is noted as *domaine public,* i.e., as in the Public Domain.
111111
+ The illustration of Leonardo Pisano / Fibonnaci in file "text/main/controlFlow/iteration/fibonacci.jpg" shows a Sculpture by Bertel Thorvaldsen, 1834/1838 and is sourced from the Thorvaldsens Museum exhibit~[A187](https://kataloget.thorvaldsensmuseum.dk/A187) photographed by Jakob Faurvig, and is published under the Creative Commons Zero ([CC0](https://creativecommons.org/publicdomain/zero/1.0)) license.
112112

113-
You can download its newest version of the course material from <https://thomasweise.github.io/databases>.
113+
You can download its newest version of the course material from <https://thomasweise.github.io/programmingWithPython>.
114114
This version may change since this course and book both are work in progress.
115115
You can cite this book as follows:
116116

text/main/controlFlow/loops/loops.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,17 @@
441441
We can apply it a file \textil{fileToScan.py} by typing \bashil{pylint fileToScan.py} in a \pgls{terminal}~(\textil{fileToScan.py} can also be a directory).
442442
Like with \ruff, in the context of this book, we will disable some \pgls{linter} rules for \pylint, too.
443443
This can be done by adding the parameter \textil{--disable=...} with the rules to be deactivated.
444-
The list of rules that \pylint\ applies when analyzing a file can be found at~\cite{PC2024PL}.
445-
444+
The list of rules that \pylint\ applies when analyzing a file can be found at~\cite{PC2024PL}.%
445+
%
446+
\begin{sloppypar}%
446447
Let us now apply both our new \pgls{linter} \pylint\ as well as \ruff, which we ave already used, to the two ideas for enumerating over the data and indices of collections.
447448
We first analyze \programUrl{loops:for_loop_no_enumerate_1}, the program where we let the index variable iterate and use it to access the data elements.
448449
In \cref{exec:loops:for_loop_no_enumerate_1:pylint}, \pylint\ suggest that we should iterate over the list \pythonil{data} using the \pythonilIdx{enumerate} function, whereas \ruff, at the time of this writing, has no issue with this approach~(see \cref{exec:loops:for_loop_no_enumerate_1:ruff}).
449450
Now we analyze \programUrl{loops:for_loop_no_enumerate_2}, where we iterate over the elements of the container and manually maintain an index variable~\pythonil{i}.
450451
Interestingly, this time \ruff\ suggests us to~\inQuotes{Use \inSQuotes{\pythonil{enumerate()}} for index variable \inSQuotes{\pythonil{i}} in \inSQuotes{\pythonil{for}} loop}, as shown in \cref{exec:loops:for_loop_no_enumerate_2:ruff}.
451-
\pylint, on the other hand, does not discover any problem with \programUrl{loops:for_loop_no_enumerate_2}.
452-
452+
\pylint, on the other hand, does not discover any problem with \programUrl{loops:for_loop_no_enumerate_2}.%
453+
\end{sloppypar}%
454+
%
453455
Our two \pglspl{linter} have discovered the same issue, just with different programs.
454456
They independently propose using a function called \pythonilIdx{enumerate} to solve the problem of iterating over collections and knowing the index of the current element.
455457
But what is \pythonilIdx{enumerate}?

0 commit comments

Comments
 (0)