Mercurial > cpython-lru_cache-weakref
diff Doc/includes/sqlite3/collation_reverse.py @ 51250:2358299564ea 3.0
Merged revisions 69190 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r69190 | mark.dickinson | 2009-02-01 14:18:10 +0000 (Sun, 01 Feb 2009) | 2 lines
Issue #1717: documentation fixes related to the cmp removal.
........
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sun, 01 Feb 2009 14:19:33 +0000 |
| parents | 9e1529bf0442 |
| children |
line wrap: on
line diff
--- a/Doc/includes/sqlite3/collation_reverse.py Sun Feb 01 14:09:04 2009 +0000 +++ b/Doc/includes/sqlite3/collation_reverse.py Sun Feb 01 14:19:33 2009 +0000 @@ -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)
