On 08/27/2015 08:07 AM, David Kupka wrote:
> On 26/08/15 17:49, Tomas Babej wrote:
>> On 08/26/2015 03:16 PM, David Kupka wrote:
>> +def deduplicate(lst):
>> + new_lst = 
>> + s = set(lst)
>> + for i in lst:
>> + if i in s:
>> + s.remove(i)
>> + new_lst.append(i)
>> + return new_lst
>> Imho, this method deserves a docstring or at least a comment. It is not
>> entrirely clear from the name, that its job is to remove the duplicates
>> while preserving the order of the entries.
> You're right, line or two could not hurt. Patch attached.
Obvious ACK from me.
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code