[stdlib-sig] proposed removal: the types module

M.-A. Lemburg mal at egenix.com
Thu Apr 3 17:09:45 CEST 2008

On 2008-04-03 16:38, Christian Heimes wrote:
> Jesse Noller schrieb:
>> On Thu, Apr 3, 2008 at 10:25 AM, Steven Bethard
>> <steven.bethard at gmail.com> wrote:
>>> Barry Warsaw schrieb:
>>>  > Plus, there are a few types in there that are difficult or impossible
>>>  > to get from Python.
>>> On Thu, Apr 3, 2008 at 6:12 AM, Barry Warsaw <barry at python.org> wrote:
>>>  >  Actually, inspect.types might be a good place to put them all.
>>>  +1 on inspect.types. If you really need to check for things like
>>>  MethodType, instead of simply hasattr(obj, '__call__'), then you're
>>>  really doing inspect-style code whether you've admitted it to yourself
>>>  yet or not. ;-)
>>>  Steve
>> +1 on inspect.types as well. It makes sense to put it there.
> For your information:
> Guido doesn't like grab bag modules, see http://bugs.python.org/issue1605

The idea to spread type objects across several different modules
is just not practical.

If you want to test for built-in types that are used by the interpreter,
then you want to look in *one central place* for the type object - not
in a gazillion different modules.

You're looking for the type object and don't want to worry about
whether this type object could be used in the context of a web
request, number crunching or counting beans.

E.g. where would you look for an Ellipsis type object, or a
memoryview, where does the iterator type object fit and what
about the traceback type object ?

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Apr 03 2008)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the stdlib-sig mailing list