how can I subclass a string (str)?
marklists at mceahern.com
Tue Aug 13 20:38:40 CEST 2002
[Martin v. Lowis]
> "Matt Gerrans" <matt_gerrans at hp.com> writes:
> > class mystr(str):
> > def HexRepr(self):
> > print 'A hex on ye!'
> Sure - but what if you want to refer to the internal representation as
I think he meant:
Of course, hex("foo") fails, but you get the idear. And if you do, kindly
explain it to me, because I sure as hell don't. ;-)
More information about the Python-list