June 1, 2008
5:43 p.m.
On Sun, Jun 1, 2008 at 3:54 AM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
The use case that was cited was recognising subclasses of UserString, and that's what I was responding to. If basestring were made subclassable and UserString inherited from it, that use case would be covered.
UserString intentionally doesn't subclass basestring. When basestring was introduced, it was specifically meant to be the base class of *only* str and unicode. There are quite a few core APIs that accept no substitutes, and being an instance of basestring was intended to guarantee that a value is accepted by such APIs. -- --Guido van Rossum (home page: http://www.python.org/~guido/)