Reputation: 671
Why is the types
module in Python 3 so small?
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
Upvotes: 12
Views: 11479
Reputation: 3584
In Python 3.x, the types
module removed all types that are already accessible via easier means like the builtin namespace. For example, you will see that ListType
and IntType
have been removed because you can simply access them via list
and int
respectively.
Upvotes: 16