[Python-Dev] Removing types module from stdlib

Neal Norwitz neal@metaslash.com
Fri, 31 May 2002 15:30:08 -0400


Guido van Rossum wrote:
> 
> > There was talk about changing string (the base class) to something
> > else since it was the same name as the module.  Was there ever a
> > decision made?
> 
> Oops, no.  Let's call it basestring.  Can you do that?

Will do.

> > But this is not what I would expect:
> >
> >       >>> import string
> >       >>> class newstr(string): pass
> >       ...
> >       # i would have expected this to raise a TypeError
> >       >>> x = newstr()
> >       Traceback (most recent call last):
> >         File "<stdin>", line 1, in ?
> >       TypeError: 'module' object is not callable
> >
> > Perhaps this error should be handled when the class is constructed
> > rather than when instantiating an object?
> 
> Can you submit a SF bug report for this?  It has nothing to do with
> string per se -- the bug is that you can use any module as a base
> class. :-(

Will do.

Neal