better way than: myPage += 'more html' , ...

Gerrit Holl gerrit at
Thu Jun 26 11:25:10 CEST 2003

Delaney, Timothy C (Timothy) wrote:
> import cStringIO as StringIO
> # Subclass of str so that it can be used nearly anywhere that requires a real
> # string.
> class MutableString (str):
>     def __init__ (self, s=""):
>         super(MutableString, self).__init__()
> = StringIO.StringIO()
>     def __add__(self, s):
>         m = MutableString(
>         return m
>     def __iadd__(self, s):
>         return self
>     def __str__(self):
>         return
>     def __repr__(self):
>         return repr(str(self))

You could even add __setitem__ and __getitem__ and implement it with


62. If he do not plant the field that was given over to him as a
garden, if it be arable land (for corn or sesame) the gardener shall pay
the owner the produce of the field for the years that he let it lie
fallow, according to the product of neighboring fields, put the field in
arable condition and return it to its owner.
        -- 1780 BC, Hammurabi, Code of Law
Asperger Syndroom - een persoonlijke benadering:
Het zijn tijden om je zelf met politiek te bemoeien:

More information about the Python-list mailing list