From 88ac4e9030ab5827d1ab4d01ee6c0aff85184d28 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 11 Nov 2012 20:35:08 -0500 Subject: keyword: use Python 2/3-agnostic set notation in reduce_keywords doctest Python 2.7 prints sets as "set([1, 2])", but Python 3.2 prints them as "{1, 2}". Avoid having to chose by showing that the result of reduce_keywords() is a set, and then printing the elements in a list. --- pym/gentoolkit/keyword.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pym/gentoolkit/keyword.py') diff --git a/pym/gentoolkit/keyword.py b/pym/gentoolkit/keyword.py index 17b3472..a234116 100644 --- a/pym/gentoolkit/keyword.py +++ b/pym/gentoolkit/keyword.py @@ -95,8 +95,11 @@ def reduce_keywords(keywords): """Reduce a list of keywords to a unique set of stable keywords. Example usage: - >>> reduce_keywords(['~amd64', 'x86', '~x86']) - set(['amd64', 'x86']) + >>> kw = reduce_keywords(['~amd64', 'x86', '~x86']) + >>> isinstance(kw, set) + True + >>> sorted(kw) + ['amd64', 'x86'] @type keywords: array @rtype: set -- cgit v1.2.3-65-gdbad