bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942)
(cherry picked from commit b146568dfcbcd7409c724f8917e4f77433dd56e4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 67ea2b1..314d3a5 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -165,9 +165,10 @@
that 'mytype' is the type of the column. It will try to find an entry of
'mytype' in the converters dictionary and then use the converter function found
there to return the value. The column name found in :attr:`Cursor.description`
- is only the first word of the column name, i. e. if you use something like
- ``'as "x [datetime]"'`` in your SQL, then we will parse out everything until the
- first blank for the column name: the column name would simply be "x".
+ does not include the type, i. e. if you use something like
+ ``'as "Expiration date [datetime]"'`` in your SQL, then we will parse out
+ everything until the first ``'['`` for the column name and strip
+ the preceeding space: the column name would simply be "Expiration date".
.. function:: connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements, uri])