You don't need to override __init__ here.
My my my....
which makes subclassing almost useless - except to pass isinstance() tests.
You could replace subclassing by composition/delegation using the
__getattr__ hook, but this would break tests on type/class :(
Or you could keep subclassing and use the __getattribute__ hook, but
this is more tricky and IIRC may have negative impact on lookup perfs.
Or you could use a metaclass to decorate (appropriate) str methods with
a decorator doing the additional stuff.
choose your poison !-)
Won't work. You need to override the __new__ staticmethod. Look for
appropriate doc here:
(FWIW, read the whole page)
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in ' XXXX@XXXXX.COM '.split('@')])"