[Python-Dev] PEP 294: Type Names in the types Module

Peter Funk pf@artcom-gmbh.de
Tue, 25 Jun 2002 10:56:47 +0200 (CEST)


> Oren Tirosh <oren-py-l@hishome.net> writes:
> >         types.IntegerType -> types.int
> >         types.FunctionType -> types.function
> >         types.TracebackType -> types.traceback
> >          ...    
> > 
> >     The long capitalized names currently in the types module will be
> >     deprecated.
Michael Hudson:
> I mean, I don't have any real opinion *against* this pep, I just don't
> really see why anyone would care...

I care and I've a strong opinion against this PEP and any other so
called "enhancement", which makes it harder or impossible to write
Python code *NOW*, which covers a certain range of Python language

The Python documentation advertises the 'types' module with the following 

  """This module defines names for all object types that are used by 
     the standard Python interpreter, [...]
     It is safe to use "from types import *" -- the module does not 
     export any names besides the ones listed here. New names exported 
     by future versions of this module will all end in "Type".  """

This makes promises about future versions of this module and the the
Python language.  Breaking promises is in general a very bad idea
and will do serious harm to trustworthiness.

At the time of this writing the oldest Python version I have to
support is Python 1.5.2 and this will stay so until at least the end
of year 2004.

So any attempts to deprecate often used language features does no 
good other than demotivating people to start using Python.  

It would be possible to change the documentation of types module now
and start telling users that the Python development team made up
their mind.  That would open up the possibility to really deprecate
the module or change the type names later (but only much much later!),
without causing the effect I called "version fatigue" lately here.

A look at http://www.python.org/dev/doc/devel/lib/module-types.html
showed that this didn't happened yet.  Sigh!

Regards, Peter
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen, Germany)