Result of ``a is b''

Axel Boldt axelboldt at
Fri Mar 19 00:37:05 CET 2004

"DomF" <fidtz at> wrote in message news:<1079629638.19728.0 at>...
> > 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.


More information about the Python-list mailing list