diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2022-08-31 07:54:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 07:54:54 +0200 |
commit | f7e7bf161aaec5a5cffdcec7c97e1f09e445421b (patch) | |
tree | e9d339cca5899de4dd2fed407baad75af2631d96 /Doc/includes/sqlite3/row_factory.py | |
parent | 8ba22b90cafdf83d26318905a021311c6932d2c0 (diff) | |
download | cpython-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.py | 15 |
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() |