projects
/
gentoolkit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88ac4e9
)
keyword: define keyword_list in compare_strs doctest
author
W. Trevor King
<wking@tremily.us>
Mon, 12 Nov 2012 01:41:55 +0000
(20:41 -0500)
committer
W. Trevor King
<wking@tremily.us>
Mon, 12 Nov 2012 01:41:55 +0000
(20:41 -0500)
This is not much of a doctest, since we aren't using compare_strs()
anywhere, but at least it doesn't error out. Note that comparisons
have been reworked in Python 3 where cmp() has been removed.
pym/gentoolkit/keyword.py
patch
|
blob
|
history
diff --git
a/pym/gentoolkit/keyword.py
b/pym/gentoolkit/keyword.py
index a234116895cf8c5dbc5b01217e01ce397f0fdfed..0f3807cfe972484ee387b946da18820f660bf138 100644
(file)
--- a/
pym/gentoolkit/keyword.py
+++ b/
pym/gentoolkit/keyword.py
@@
-75,6
+75,7
@@
def compare_strs(kw1, kw2):
as: keyword_list.sort(keyword.compare_strs)
An alternative is to use the Keyword descriptor directly:
+ >>> keyword_list = ['~x86', '~amd64', 'x86']
>>> kwds = sorted(Keyword(x) for x in keyword_list)
@see: >>> help(cmp)