Skip to content

Commit 9d794c1

Browse files
committed
clarified mypy vs. literalstring
1 parent 50c39ab commit 9d794c1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@
268268
Such attacks can be prevented if the queries to \dbs\ are never dynamically constructed by the likes of \pglspl{fstring} but instead are always defined as string constants.
269269
\python\ supports the type~\pythonilIdx{LiteralString} for string constants~\cite{PEP675}.
270270
Implementations of the \python\ \db\ \pgls{API}, such as \psycopg~\cite{VDGE2022PPDAFP:ST}, can be annotated to only accept such strings.
271-
Hence, a type checker like \mypy\ would detect and complain if you would try to dynamically construct queries, thus preventing \pglspl{SQLi} -- but only if you use it\dots%
271+
Hence, a type checker could detect and complain if you would try to dynamically construct queries, thus preventing \pglspl{SQLi} -- but only if you use it\dots
272+
At the time of this writing, \mypy\ does not yet support this functionality, though~\cite{ZDWVSLS2022I1SP6L,VDGE2022PPDAFP:ST}.
272273
%
273274
\FloatBarrier%
274275
\endhsection%

0 commit comments

Comments
 (0)