◐ Shell
clean mode source ↗

Message 224852 - Python tracker

Example:
>>> import rlcompleter
>>> completer = rlcompleter.Completer()
>>> class A(object):
...     foo = None
>>> class B(A):
...     pass
>>> b = B()
>>> print([completer.complete("b.foo", i) for i in range(4)])
['b.foo', 'b.foo', 'b.foo', None]

I would expect the completions to be unique.
This happens because the possible words to match are put into a list.
A possible fix is putting them into a set instead.
Patch attached.