Result of ``a is b''

Axel Boldt axelboldt at yahoo.com
Thu Mar 18 18:37:05 EST 2004


"DomF" <fidtz at clara#spam#.co.uk> wrote in message news:<1079629638.19728.0 at lotis.uk.clara.net>...
> > Indeed I have not. Probably because basic built-in strings form a type
> > that's not a class and you can't inherit from it.
> >
> Mostly because I am interested in the counter argument:
> 
> class mynewstr(str):
> ...     pass
> ...
> >>> s = mynewstr()
> >>> dir(s)
> <<list of str stuff>>

I stand corrected, I don't think there is a counter argument. So then
the objection of Asun Friere remains: could a redefinition of "is" for
strings affect the behavior of classes derived from str? I don't know.

Axel



More information about the Python-list mailing list