Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46586

Re: Surprising difference between StringIO.StringIO and io.StringIO

From Serhiy Storchaka <storchaka@gmail.com>
Subject Re: Surprising difference between StringIO.StringIO and io.StringIO
Date 2013-05-31 12:39 +0300
References <CANc-5UyDZ=ArzKrs=Y9CDwNwOunDt3DGpy5KKATZ_R=Z-LsHtA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2478.1369993195.3114.python-list@python.org> (permalink)

Show all headers | View raw


30.05.13 23:46, Skip Montanaro написав(ла):
> Am I missing something about how io.StringIO works?  I thought it was
> a more-or-less drop-in replacement for StringIO.StringIO.

io.StringIO was backported from Python 3. It is a text (unicode) stream. 
cStringIO.StringIO is a binary stream and StringIO.StringIO can be used 
as binary or unicode stream depending on arguments. Use io.BaseIO as a 
replacement for StringIO.StringIO/cStringIO.StringIO if you need a 
binary stream.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Surprising difference between StringIO.StringIO and io.StringIO Serhiy Storchaka <storchaka@gmail.com> - 2013-05-31 12:39 +0300

csiph-web