diff --git a/gensim/similarities/termsim.py b/gensim/similarities/termsim.py index 6efd7cf154..62d13a0684 100644 --- a/gensim/similarities/termsim.py +++ b/gensim/similarities/termsim.py @@ -56,14 +56,8 @@ def most_similar(self, term, topn=10): raise NotImplementedError def __str__(self): - return "%s(%s)" % ( - self.__class__.__name__, - ', '.join( - '%s=%s' % (key, value) - for key, value - in vars(self).items() - ) - ) + members = ', '.join('%s=%s' % pair for pair in vars(self).items()) + return '%s(%s)' % (self.__class__.__name__, members) class UniformTermSimilarityIndex(TermSimilarityIndex):