我在 Python 2.x 中有一个部分排序的元组。
为什么 Python 反转它而不是排序它?
>>> data = (u'a', (1,), 'b ', u'b', (2,), 'c ', u'c', (3,), 'd ', u'd', (4,), 'e')
>>> sorted(data) == list(reversed(data))
True
我期待 Python 3。
我在 Python 2.x 中有一个部分排序的元组。
为什么 Python 反转它而不是排序它?
>>> data = (u'a', (1,), 'b ', u'b', (2,), 'c ', u'c', (3,), 'd ', u'd', (4,), 'e')
>>> sorted(data) == list(reversed(data))
True
我期待 Python 3。