[stdlib-sig] proposed removal: the types module

Jeffrey Yasskin jyasskin at gmail.com
Thu Apr 3 19:01:42 CEST 2008


On Thu, Apr 3, 2008 at 8:09 AM, M.-A. Lemburg <mal at egenix.com> wrote:
> 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

Just to pick one, try "type(...)". It's generally clearer to take an
example of what you want and ask for its type, than to look in the
types module.

>  memoryview, where does the iterator type object fit and what
>  about the traceback type object ?
>
>
>  --
>  Marc-Andre Lemburg
>  eGenix.com
>
>  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
>  _______________________________________________
>
>
> stdlib-sig mailing list
>  stdlib-sig at python.org
>  http://mail.python.org/mailman/listinfo/stdlib-sig
>



-- 
Namasté,
Jeffrey Yasskin
http://jeffrey.yasskin.info/


More information about the stdlib-sig mailing list