Still the __new__ hell ...

Alex Martelli aleax at mac.com
Tue Mar 20 11:11:27 EDT 2007


Aahz <aahz at pythoncraft.com> wrote:

> In article <1hv8x6v.1x0ceur1nnwi46N%aleax at mac.com>,
> Alex Martelli <aleax at mac.com> wrote:
> >Steve Holden <steve at holdenweb.com> wrote:
> >> 
> >> basestring is a *type*.
> >> 
> >>   >>> basestring
> >> <type 'basestring'>
> >> 
> >> It's the base class of which both str and unicode are subclasses.
> >
> >I believe it used to be a tuple back in Python 2.2 (sorry, don't have a
> >Python 2.2 installation to check this right now).
> 
> Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
> [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> basestring
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: name 'basestring' is not defined

Thanks for double checking on my vague and apparently incorrect
historical memory!  Obviously I must have been thinking of some _trick_
whereby one bound basestring to the pair to make isinstance on
basestring work in 2.2 much as it did later, rather than an intrinsic
2.2 feature.


Alex



More information about the Python-list mailing list