首页 > 技术文章 > TypeError: '

flyingcr 2018-02-05 16:34 原文

    bigL = [v[0] for v in sorted(headerTable.items(), key=lambda p: p[1])]#(sort header table)
TypeError: '<' not supported between instances of 'treeNode' and 'treeNode'

这个的意思就是比较的对象不支持小于符号

也就是我们的对象有问题,这里我的p[1]是节点类型

 headerTable:  {'p': [2, None], 'h': [1, None], 'r': [3, None], 'j': [1, None], 'z':
所以还需要对P[1]进行取值p[1][0]

推荐阅读