summaryrefslogtreecommitdiffstats
path: root/Doc/includes/sqlite3
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-02-01 14:18:10 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-02-01 14:18:10 (GMT)
commitc48d83402687c0c5d6da1c7bb1a677208effa35e (patch)
tree3bc0e90855d9d77d2355e0e477c354d765db12b0 /Doc/includes/sqlite3
parentc008a176afdef8cb7afc0e48a8fb306f986964e8 (diff)
downloadcpython-c48d83402687c0c5d6da1c7bb1a677208effa35e.zip
cpython-c48d83402687c0c5d6da1c7bb1a677208effa35e.tar.gz
cpython-c48d83402687c0c5d6da1c7bb1a677208effa35e.tar.bz2
Issue #1717: documentation fixes related to the cmp removal.
Diffstat (limited to 'Doc/includes/sqlite3')
-rw-r--r--Doc/includes/sqlite3/collation_reverse.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/includes/sqlite3/collation_reverse.py b/Doc/includes/sqlite3/collation_reverse.py
index bfd7f5b..3504a35 100644
--- a/Doc/includes/sqlite3/collation_reverse.py
+++ b/Doc/includes/sqlite3/collation_reverse.py
@@ -1,7 +1,12 @@
import sqlite3
def collate_reverse(string1, string2):
- return -cmp(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)