diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2022-08-31 05:54:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 05:54:54 (GMT) |
commit | f7e7bf161aaec5a5cffdcec7c97e1f09e445421b (patch) | |
tree | e9d339cca5899de4dd2fed407baad75af2631d96 /Doc/includes/sqlite3/collation_reverse.py | |
parent | 8ba22b90cafdf83d26318905a021311c6932d2c0 (diff) | |
download | cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.zip cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.gz cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.bz2 |
gh-96414: Inline code examples in sqlite3 docs (#96442)
Diffstat (limited to 'Doc/includes/sqlite3/collation_reverse.py')
-rw-r--r-- | Doc/includes/sqlite3/collation_reverse.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Doc/includes/sqlite3/collation_reverse.py b/Doc/includes/sqlite3/collation_reverse.py deleted file mode 100644 index 3504a35..0000000 --- a/Doc/includes/sqlite3/collation_reverse.py +++ /dev/null @@ -1,20 +0,0 @@ -import sqlite3 - -def collate_reverse(string1, string2): - if string1 == string2: - return 0 - elif string1 < string2: - return 1 - else: - return -1 - -con = sqlite3.connect(":memory:") -con.create_collation("reverse", collate_reverse) - -cur = con.cursor() -cur.execute("create table test(x)") -cur.executemany("insert into test(x) values (?)", [("a",), ("b",)]) -cur.execute("select x from test order by x collate reverse") -for row in cur: - print(row) -con.close() |