[Python-Dev] removing the new and types modules

Nick Coghlan ncoghlan at gmail.com
Wed Nov 28 12:36:37 CET 2007


Redirecting discussion from python-checkins to python-dev.

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

Christian Heimes wrote:
> Georg Brandl wrote:
>> I've just looked, and the types you can't get trivially via builtin or
>> type(singleton) are
>>
>> * module
>> * function
>> * generator
>> * code
>> * method
>> * builtin-function-or-method
>> * frame
>> * traceback
>> * dictproxy
>> * getset- and member-descriptor
>>
>> Where would one put them?
> 
> Python 3.0 has several more types that aren't exposed through types. For
> example the views like dict_keys, dict_values and dict_items are not in
> types.

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).

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).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-Dev mailing list