Skip to content

Commit 36017f2

Browse files
committed
new quotation command, reference to sqlite
1 parent 70413cb commit 36017f2

File tree

8 files changed

+28
-9
lines changed

8 files changed

+28
-9
lines changed

bookbase

text/main/basics/variables/typesAndTypeHints/typesAndTypeHints.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
There are good reasons for always using \pglspl{typeHint}.
209209
While not specifying variable types is very convenient, it comes at a high cost:%
210210
%
211-
\quotation{J2025TIFJ2JHPITPLOTY2}{\python's only serious drawbacks are (and thus leaving room for competition) its lack of performance and \emph{that most errors occur run-time}.}%
211+
\cquotation{J2025TIFJ2JHPITPLOTY2}{\python's only serious drawbacks are (and thus leaving room for competition) its lack of performance and \emph{that most errors occur run-time}.}%
212212
%
213213
Type-related errors are one category of mistakes that will become visible only at runtime.
214214
At the same time, these are errors that can relatively easily be discovered during code analysis.

text/main/classes/basics/basics.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
They are marked with the \pgls{typeHint} \pythonilIdx{Final} and thus changing them is an error.
257257
In many cases, making objects immutable is a good design pattern.%
258258
%
259-
\quotation{B2008EJ}{%
259+
\cquotation{B2008EJ}{%
260260
Classes should be immutable unless there’s a very good reason to make them mutable{\dots}.
261261
If a class cannot be made immutable, limit its mutability as much as possible.%
262262
}%

text/main/classes/dunder/dunder.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
If so, it will return \pythonil{True} if and only if the \pythonil{x} and \pythonil{y} coordinate of the \pythonil{other} point are the same as of the point \pythonil{self}.
144144
Otherwise, it will return the constant \pythonilIdx{NotImplemented}:%
145145
%
146-
\quotation{PSF2024BIC}{%
146+
\cquotation{PSF2024BIC}{%
147147
A special value which should be returned by the binary special methods [\dots] to indicate that the operation is not implemented with respect to the other type\dots\medskip\\\strut\hspace{1cm}\strut%
148148
\emph{Note:}~When a binary (or in-place) method returns \pythonilIdx{NotImplemented} the interpreter will try the reflected operation on the other type (or some other fallback, depending on the operator). %
149149
If all attempts return \pythonilIdx{NotImplemented}, the interpreter will raise an appropriate exception. %
@@ -253,7 +253,7 @@
253253
In \cref{lst:dunder:point_with_hash}, we modify the \pythonil{Point} class from \cref{lst:dunder:point_with_dunder}.
254254
We retain the implementation of~\dunder{eq} and add the method~\dunder{hash}.%
255255
%
256-
\quotation{PSF2024OH}{{\dots}The \pythonil{\_\_hash\_\_()}\pythonIdx{\_\_hash\_\_}\pythonIdx{dunder!\_\_hash\_\_} method should return an integer. %
256+
\cquotation{PSF2024OH}{{\dots}The \pythonil{\_\_hash\_\_()}\pythonIdx{\_\_hash\_\_}\pythonIdx{dunder!\_\_hash\_\_} method should return an integer. %
257257
The only required property is that objects which compare equal have the same hash value; %
258258
it is advised to mix together the hash values of the components of the object that also play a part in comparison of objects by packing them into a \pythonil{tuple} and hashing the tuple.}%
259259
%
@@ -301,7 +301,7 @@
301301
Actually, I secretly planned to use this as a very tricky example for learning how to use the debugger{\dots}
302302
Alas, the developers of \python\ have already solved this:%
303303
%
304-
\quotation{PSF2024BIF}{Numeric values that compare equal have the same \pythonilIdx{hash} value (even if they are of different types, as is the case for~\pythonil{1} and~\pythonil{1.0}).}%
304+
\cquotation{PSF2024BIF}{Numeric values that compare equal have the same \pythonilIdx{hash} value (even if they are of different types, as is the case for~\pythonil{1} and~\pythonil{1.0}).}%
305305
%
306306
Therefore, we can indeed implement \dunder{hash} with a single line of code in~\cref{sec:hashDunder}.
307307
And I will later find another example on how the debugger can be used to spot errors in code.%

text/main/controlFlow/exceptions/exceptions.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@
576576
\pylint\ suggests to go with a \pythonilIdx{with}~statement instead.
577577
They both mean the same.
578578

579-
\quotation{PSF2024WSCM}{%
579+
\cquotation{PSF2024WSCM}{%
580580
A context manager is an object that defines the runtime context to be established when executing a \pythonilIdx{with} statement. %
581581
The context manager handles the entry into, and the exit from, the desired runtime context for the execution of the block of code. %
582582
[\dots] %

text/main/controlFlow/functions/functions.tex

+19
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,25 @@
488488
A good unit test for a function should cover all branches of the control flow inside the function. %
489489
If a function does one thing in one situation and another thing in another situation, then both of these scenarios should have associated unit tests.%
490490
}%
491+
%
492+
Many junior programmers are not aware how important unit testing is.
493+
Being able to understand, design, and use unit tests is one of the most important abilities in software development.%
494+
%
495+
\cquotation{GPBHKP2022SPPAF}{
496+
No single factor is likely responsible for \sqlite's popularity.
497+
Instead, in addition to its fundamentally embeddable design, several characteristics combine to make \sqlite\ useful in a broad range of scenarios.
498+
In particular, \sqlite\ strives to be:\par\relax[\dots]\par\relax%
499+
\textbf{Reliable}.
500+
There are over 600~lines of test code for every line of code in \sqlite~\cite{HO2023WKUOS}.
501+
Tests cover 100\% of branches in the library.
502+
The test suite is extremely diverse, including fuzz tests, boundary value tests, regression tests, and tests that simulate operating system crashes, power losses, I/O~errors, and out-of-memory errors.
503+
Due to its reliability, \sqlite\ is often used in mission-critical applications such as flight software~\cite{HO2024HSIT}%
504+
}%
505+
%
506+
\sqlite\ is the most used \pgls{SQL} \pgls{db} in the world.
507+
It is installed in nearly every smartphone, computer, web browser, television, and automobile~\cite{WB2019RHSOOS,GPBHKP2022SPPAF,C20245YOQ}.
508+
And its core developers mark reliability, shown by thorough tests, as one of the four reasons for that.%
509+
%
491510
\endhsection%
492511
%
493512
\hsection{Function Arguments: Default Values, Passing them by Name, and Constructing them}%

text/main/controlFlow/iteration/iteration.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
All of the measured runtimes are then return as a \pythonil{list[float]}.
209209
The documentation of \pythonilIdx{timeit}~\cite{PSF2024TMETOSCS} says:%
210210
%
211-
\quotation{PSF2024TMETOSCS}{%
211+
\cquotation{PSF2024TMETOSCS}{%
212212
\emph{Note:}~it's tempting to calculate mean and standard deviation from the result vector and report these.
213213
However, this is not very useful.
214214
In a typical case, the lowest value gives a lower bound for how fast your machine can run the given code snippet;

text/main/introduction/whyPython/whyPython.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
We find that \python\ became the leading languages at some point in~2018.
1717
In the TIOBE index, which counts the number of hits when searching for a programming language using major search engines, \python\ ranked one in January 2025 and was named the programming language of the year for~2024~\cite{J2025TIFJ2JHPITPLOTY2}.%
1818
%
19-
\quotation{J2025TIFJ2JHPITPLOTY2}{\python\ is everywhere nowadays, and it is the undisputed default language of choice in many fields.}%
19+
\cquotation{J2025TIFJ2JHPITPLOTY2}{\python\ is everywhere nowadays, and it is the undisputed default language of choice in many fields.}%
2020
%
2121
If you will do programming in any future employment or research position, chances are that \python\ knowledge will be useful.
2222
According to the 2024 annual Stack Overflow survey~\cite{Y2025DWMMMT2RFSOADS}, \python\ was the second most popular programming language, after \pgls{javascript} and HTML/CSS.

0 commit comments

Comments
 (0)