[Python-Dev] Iterable String Redux (aka String ABC) (original) (raw)
Guido van Rossum guido at python.org
Mon Jun 2 00:43:38 CEST 2008
- Previous message: [Python-Dev] Iterable String Redux (aka String ABC)
- Next message: [Python-Dev] Iterable String Redux (aka String ABC)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, Jun 1, 2008 at 3:54 AM, Greg Ewing <greg.ewing at 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/)
- Previous message: [Python-Dev] Iterable String Redux (aka String ABC)
- Next message: [Python-Dev] Iterable String Redux (aka String ABC)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]