Improving cStringIO API (Request For Comments)

Just van Rossum just at letterror.com
Tue Jun 27 05:31:56 EDT 2000


At 11:03 PM +0000 22-06-2000, Michael D. Marchionna wrote:
[ snip ]
>Comments and suggestions?

It seems you're using the wrong object. [c]StringIO is a stream, not an
array. If you need a hybrib between a stream and an array, the thing to do
is to write one. Modifying a standard module is usually a bad idea.
(Especially in this case, where the cStringIO and StringIO modules are two
implementations of the same interface: both need to be kept in sync.)

Check out the array module. It should be easy enough to whip up a class
that does what you want, using arrays underneath.


Just






More information about the Python-list mailing list