aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Doc/includes/sqlite3/row_factory.py
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2022-08-31 07:54:54 +0200
committerGitHub <noreply@github.com>2022-08-31 07:54:54 +0200
commitf7e7bf161aaec5a5cffdcec7c97e1f09e445421b (patch)
treee9d339cca5899de4dd2fed407baad75af2631d96 /Doc/includes/sqlite3/row_factory.py
parent8ba22b90cafdf83d26318905a021311c6932d2c0 (diff)
downloadcpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.gz
cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.zip
gh-96414: Inline code examples in sqlite3 docs (#96442)
Diffstat (limited to 'Doc/includes/sqlite3/row_factory.py')
-rw-r--r--Doc/includes/sqlite3/row_factory.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/Doc/includes/sqlite3/row_factory.py b/Doc/includes/sqlite3/row_factory.py
deleted file mode 100644
index 9de6e7b1b90..00000000000
--- a/Doc/includes/sqlite3/row_factory.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import sqlite3
-
-def dict_factory(cursor, row):
- d = {}
- for idx, col in enumerate(cursor.description):
- d[col[0]] = row[idx]
- return d
-
-con = sqlite3.connect(":memory:")
-con.row_factory = dict_factory
-cur = con.cursor()
-cur.execute("select 1 as a")
-print(cur.fetchone()["a"])
-
-con.close()