发布网友 发布时间:2022-05-02 14:21
共3个回答
热心网友 时间:2022-04-18 10:29
The cmp() function should be treated as gone, and the __cmp__() special method is no longer supported. Use __lt__() for sorting, __eq__() with __hash__(), and other rich comparisons as needed. (If you really need the cmp() functionality, you could use the expression (a > b) - (a < b) as the equivalent for cmp(a, b).)热心网友 时间:2022-04-18 11:47
一定是你的书太老了,介绍的py2.2左右的版本,现在推荐学2.7或者3.2版热心网友 时间:2022-04-18 13:21
cmp(dic3,dict4)