|
86 | 86 | \label{fig:pipInstallMypy}%
|
87 | 87 | \end{figure}%
|
88 | 88 | %
|
89 |
| -\gitOutput{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_wrong.py}{variables:variable_types_wrong:mypy}{% |
| 89 | +\gitOutputTool{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_wrong.py}{variables:variable_types_wrong:mypy}{% |
90 | 90 | The results of static type checking with \mypy\ of the program given in \cref{lst:variables:types_wrong}. %
|
91 | 91 | (This is actually output generated by the script~\cref{lst:bash:mypy} on \cpageref{lst:bash:mypy}.)}%
|
92 | 92 | %
|
93 |
| -\gitOutput{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types.py}{variables:variable_types:mypy}{% |
| 93 | +\gitOutputTool{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types.py}{variables:variable_types:mypy}{% |
94 | 94 | The results of static type checking with \mypy\ of the program given in \cref{lst:variables:types}. %
|
95 | 95 | (This is actually output generated by the script~\cref{lst:bash:mypy} on \cpageref{lst:bash:mypy}.)}%
|
96 | 96 | %
|
|
171 | 171 | \gitPythonAndOutput{\programmingWithPythonCodeRepo}{01_variables}{variable_types_wrong_hints_2.py}{--args format}{variables:types_wrong_hints_2}{%
|
172 | 172 | \cref{lst:variables:types_wrong}, but with the variable explicitly hinted as either \pythonil{int} or \pythonil{float} and named appropriately.}%
|
173 | 173 | %
|
174 |
| -\gitOutput{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_wrong_hints_1.py}{variables:variable_types_wrong_hints_1:mypy}{% |
| 174 | +\gitOutputTool{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_wrong_hints_1.py}{variables:variable_types_wrong_hints_1:mypy}{% |
175 | 175 | The results of static type checking with \mypy\ of the program given in \cref{lst:variables:types_wrong_hints_1}.}%
|
176 | 176 | %
|
177 |
| -\gitOutput{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_wrong_hints_2.py}{variables:variable_types_wrong_hints_2:mypy}{% |
| 177 | +\gitOutputTool{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_wrong_hints_2.py}{variables:variable_types_wrong_hints_2:mypy}{% |
178 | 178 | The results of static type checking with \mypy\ of the program given in \cref{lst:variables:types_wrong_hints_2}.}%%
|
179 | 179 |
|
180 | 180 | If the author of \cref{lst:variables:types_wrong} had used type hints, they could have written their program differently, as illustrated in \cref{lst:variables:types_wrong_hints_1,lst:variables:types_wrong_hints_2}.
|
|
207 | 207 | \gitPython{\programmingWithPythonCodeRepo}{01_variables/variable_types_hints.py}{--args format}{variables:types_hints}{%
|
208 | 208 | A variant of \cref{lst:variables:types} which has been improved by adding type annotations.}%
|
209 | 209 | %
|
210 |
| -\gitOutput{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_hints.py}{variables:variable_types_hints:mypy}{% |
| 210 | +\gitOutputTool{\programmingWithPythonCodeRepo}{.}{scripts/mypy.sh 01_variables variable_types_hints.py}{variables:variable_types_hints:mypy}{% |
211 | 211 | The results of static type checking with \mypy\ of the program given in \cref{lst:variables:types_hints}.}
|
212 | 212 |
|
213 | 213 | For the sake of completeness, let us also annotate \cref{lst:variables:types} with type hints as a small exercise.
|
|
0 commit comments