From: why the lucky stiff Date: 2004-04-24T05:02:48+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. I don't know exactly what you're getting at, but, in watching checkins on Ruby CVS, anything that read: if obj.is_a? IO was swapped to: if obj.respond_to? :read over the last year. I'm not saying StringIO shouldn't inherit from IO. Just that it's become less important what descends from IO and more important what implements obj#read. _why