【发布时间】:2014-09-13 17:13:43
【问题描述】:
只是好奇,仅此而已。为什么在 Python3 中删除了字典大小比较 (> < >= <=)?删除它们的原因是什么?
例如:dictA > dictB
【问题讨论】:
-
什么是字典大小比较?
-
我猜它类似于
if dict_a > dict_b:,它在 Python 2 中运行,但在 Python 3 中提供TypeError: unorderable types。 -
你可以尝试搜索相关的提交历史,这是公开的。它可能包含基本原理、PEP 链接或对邮件列表讨论的引用。
-
你的意思是simplification of ordering comparisons?这是在 Python 3.0 中完成的。
-
如果是这样,那么这与Is everything greater than None?和其他此类帖子密切相关。
标签: python python-3.x