From: daz Date: 2004-04-24T09:39:07+09:00 Subject: Re: StringIO Hal Fulton wrote: > I've been playing with StringIO, and I've found that it doesn't inherit > from IO. > > I had thought this would be natural, as it would in theory permit us to > use a StringIO wherever an IO is used. > Agree. I ran into it recently in this form ( ruby 1.9.0 (2004-03-21) [i586-bccwin32] ): #----- require 'stringio' sio = StringIO.new STDOUT.reopen(sio) #----- #-> C:/TEMP/rb7162.TMP:5:in `reopen': cannot convert StringIO into IO (TypeError) I understand Matz is a fan of StringIO. (I can find references if he wants to argue ;) daz