[Python-Dev] removing the new and types modules

Christian Heimes lists at cheimes.de
Wed Nov 28 14:51:10 CET 2007


Nick Coghlan wrote:
> 'new' has now been deprecated for 3.0, GvR suggested it would be nice to 
> get rid of 'types' as well.

I've removed the 'new' module from py3k and also removed a lot of types
from the 'types' module in py3k. It only contains types that aren't
easily available through builtins.

> Most of those 'hard-to-get-at' types are tied pretty tightly to the 
> interpreter internals, and would fit in with Guido's suggestion of a 
> 'pyvm' module. Such a module would let us clean up the 'sys' namespace a 
> little bit by moving some of the more arcane hackery to another module 
> (like the recursion limit and the threading check interval).

Can we leave 'pyvm' until the next alpha is out? We are already near the
schedule for mid to end of November.

> The only ones I would suggest putting elsewhere are the module type 
> (exposing it through the imp module instead), and the new 
> dict_keys/_values/_items types (exposing them through the collections 
> module, as others have suggested).

Several other types are used in the Python core, too. The most
remarkable is MethodType (to bind functions to instances) but also
FunctionType and CodeType.

Christian



More information about the Python-Dev mailing list