[Python-Dev] Re: [Python-checkins] python/dist/src/Lib types.py,1.26,1.27

Martin v. Loewis martin@v.loewis.de
22 May 2002 20:56:16 +0200


Skip Montanaro <skip@pobox.com> writes:

> You find this in a lot of code:
> 
>     from types import *
> 
> Given that every other type is exposed through the types module it just
> seems kind of odd to force people to use isinstance() for bools, but have
> the old way of doing things continue to work for every other type.  

What old way? You mean, you want to write

  type(x) is BooleanType

You can write just as fine

  type(x) is bool

> I think you can stop adding new types to the types module if and
> when you deprecate it, but not before.

I feel adding BooleanType was a bad thing. It is not needed; there is
only one way to do it.

Regards,
Martin