From: W. Trevor King Date: Mon, 12 Nov 2012 01:41:55 +0000 (-0500) Subject: keyword: define keyword_list in compare_strs doctest X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=66ff38b27402e0412a842bc00788887d24da56b4;p=gentoolkit.git keyword: define keyword_list in compare_strs doctest 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. --- diff --git a/pym/gentoolkit/keyword.py b/pym/gentoolkit/keyword.py index a234116..0f3807c 100644 --- 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)