Skip to content

Commit 98db086

Browse files
committed
improved f-strings in examples
1 parent 60df85e commit 98db086

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

bibliography/bibliography.bib

+13
Original file line numberDiff line numberDiff line change
@@ -2398,6 +2398,19 @@ @inbook{PSF2024TSTS
23982398
urldate = {2024-07-25},
23992399
}
24002400

2401+
@xdata{PSF2024WNIP,
2402+
volume = {What's New in \python},
2403+
crossref = {PSF2024P3D}
2404+
}
2405+
2406+
@inbook{PSF2024WNIP38FSFSDEAD,
2407+
title = {What's New In \python~3.8: \pglspl{fstrings} Support \pythonil{=} for Self-Documenting Expressions and Debugging},
2408+
author = a_hettinger_raymond,
2409+
xdata = {PSF2024WNIP},
2410+
url = {https://docs.python.org/3/whatsnew/3.8.html#bpo-36817-whatsnew},
2411+
urldate = {2024-12-01}
2412+
}
2413+
24012414
@inbook{PTVF2007EAAS,
24022415
title = {1.1~Error, Accuracy, and Stability},
24032416
chapter = {1~Preliminaries},

text/main/basics/simpleDataTypesAndOperations/str/str.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
\pythonil{f"Single braces without expression: \{\{ and \}\}."} simply becomes \pythonil{"Single braces without expression: \{ and \}."}
280280

281281
As final example, let us look at a very cool ability of \pglspl{fstring}\pythonIdx{f-string!=}.
282-
Often, we want to print an expression together with its result.
282+
Often, we want to print an expression together with its result~\cite(PSF2024WNIP38FSFSDEAD).
283283
Earlier, we wrote \pythonil{f"\{5\}\ + \{4\}\ = \{5 + 4\}"} is evaluated to \pythonil{"5 + 4 = 9"}.
284284
What we actually wanted to print was the expression \pythonil{5 + 4} together with its result.
285285
This can be done much easier:

0 commit comments

Comments
 (0)