提交 75b9b611 authored 作者: nouiz's avatar nouiz

Merge pull request #958 from lamblin/fix_py24

Change syntax for python 2.4
......@@ -36,7 +36,15 @@ def test__toposort():
def test_posort_easy():
nodes = "asdfghjkl"
cmp = lambda a,b: -1 if a<b else 1 if a>b else 0
def cmp(a, b):
if a < b:
return -1
elif a > b:
return 1
else:
return 0
assert posort(nodes, cmp) == list("adfghjkls")
def test_posort():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论