This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients benjamin.peterson, docs@python, pitrou, skip.montanaro
Date 2010-08-30.14:13:38
SpamBayes Score 5.7894596e-09
Marked as misclassified No
Message-id <19579.48267.999574.22463@montanaro.dyndns.org>
In-reply-to <AANLkTimGdHnz85q4HT2oE+Ri7GqaTcJMU33RujLqod7y@mail.gmail.com>
Content
>> Finally, not specific to this change, but I wonder if rather than
    >> having distinct io.StringIO and io.BytesIO classes it would be better
    >> to have a single io.MemoryIO class which takes mode arguments just
    >> like io.FileIO?  The correspondence between file-based and memory-
    >> based i/o would be more one-to-one.  Such a class could be added
    >> without breaking existing code by using the StringIO and BytesIO
    >> classes as the back-end for a MemoryIO class.

    Benjamin> What advantage would that have?

File I/O and memory I/O would have more uniform in their APIs and thus be
easier to document, describe and use.  Currently, one class is used to do
file I/O.  The type of I/O done is controlled by the mode and buffering
flags.  Two distinct classes are used to do memory I/O.

If someone wanted to select between file and memory I/O at runtime it
wouldn't be possible to just swap the class using the current code.

Skip
History
Date User Action Args
2010-08-30 14:13:40skip.montanarosetrecipients: + skip.montanaro, pitrou, benjamin.peterson, docs@python
2010-08-30 14:13:38skip.montanarolinkissue9715 messages
2010-08-30 14:13:38skip.montanarocreate