4
我有一个关于python 2.X和python 3.X之间区别的小问题。 为什么在Python 3类型模块是如此之小?日Thnxpython 3类型模块
Python 2.7
>>> import types
>>> print(len([i for i in dir(types) if not i.startswith('__')]))
37
Python 3.2
>>> import types
>>> print(len([i for i in dir(types) if not i.startswith('__')]))
12
这是您的建议还是有关于此的官方文档? – 2012-07-16 10:58:02
它在python-dev上进行了深入讨论。最初的意图是完全删除类型模块,但它被证明是不切实际的,因为没有很好的地方放置一些其他类型,如FunctionType。 这里是它原本的证据被提名为去除: http://wiki.python.org/moin/Python3.0 下面是一些Python-dev的讨论: http://mail.python.org/ pipermail/python-dev/2007-November/075384.html http://mail.python.org/pipermail/python-dev/2007-November/075456.html – ToBeReplaced 2012-07-16 11:30:28
Thnx for info – 2012-07-16 12:41:18