From: Hal Fulton Date: 2009-11-04T07:32:13+09:00 Subject: Re: StringIO and reopen --001636c5bda3b4e0e604777f10ca Content-Type: text/plain; charset=ISO-8859-1 > > This will be difficult to do because then StringIO would somehow have > to change its type. Of course you could achieve that with some kind > of proxy pattern but I doubt that this would be a good idea; we all > would always pay the price of the overhead (1 more object per IO / > StringIO) for a feature which seems rarely wanted (I cannot recall > having seen a request like this in years). > Well, reopen also can take a string, I believe. So it already takes more than one type. But the overhead argument is valid. [snip] > So for > StringIO the natural solution would be to just overwrite the variable > with another IO and make sure that there are no aliased variables > (e.g. by always referring to the single variable via a method). > > I'm not sure I understand. How would I, for example, capture all that went to standard error in a StringIO object? Hal --001636c5bda3b4e0e604777f10ca--