提交 d531d77b authored 作者: Frederic's avatar Frederic

Added comment.

上级 4482212f
......@@ -116,6 +116,11 @@ def deprecated(filename, msg=''):
def uniq(seq):
"""
Do not use set, this must always return the same value at the same index.
If we just exchange other values, but keep the same pattern of duplication,
we must keep the same order.
"""
#TODO: consider building a set out of seq so that the if condition
#is constant time -JB
return [x for i, x in enumerate(seq) if seq.index(x) == i]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论