Skip to content

Commit 2d3b7f1

Browse files
pythongh-95273: Improve sqlite3.complete_statement docs
1 parent 70fc964 commit 2d3b7f1

File tree

2 files changed

+8
-39
lines changed

2 files changed

+8
-39
lines changed

Doc/includes/sqlite3/complete_statement.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

Doc/library/sqlite3.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,16 @@ Module functions
222222

223223
.. function:: complete_statement(statement)
224224

225-
Returns ``True`` if the string *statement* contains one or more complete SQL
226-
statements terminated by semicolons. It does not verify that the SQL is
227-
syntactically correct, only that there are no unclosed string literals and the
228-
statement is terminated by a semicolon.
225+
Return ``True`` if the string *statement* appears to contain one or more
226+
complete SQL statements terminated by semicolons.
227+
No syntactic verification or parsing of any kind is performed.
229228

230-
This can be used to build a shell for SQLite, as in the following example:
229+
This function may be useful during command-line input
230+
to determine if the entered text seems to form a complete SQL statement,
231+
or if additional input is needed before :meth:`executing <Cursor.execute>`
232+
the statement.
231233

232-
.. literalinclude:: ../includes/sqlite3/complete_statement.py
234+
See :source:`Lib/sqlite3/__main__.py` for example use.
233235

234236
.. function:: enable_callback_tracebacks(flag, /)
235237

0 commit comments

Comments
 (0)