From: "nobu (Nobuyoshi Nakada)" Date: 2012-05-24T23:41:33+09:00 Subject: [ruby-core:45214] [ruby-trunk - Bug #6489][Rejected] A File instance changes its class to IO Issue #6489 has been updated by nobu (Nobuyoshi Nakada). Status changed from Open to Rejected OK. ---------------------------------------- Bug #6489: A File instance changes its class to IO https://bugs.ruby-lang.org/issues/6489#change-26799 Author: yimutang (Joey Zhou) Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] I don't know whether it is a bug, or a feature. 1.9.3p194 :001 > f = open('xxx','w') => # 1.9.3p194 :002 > f.class => File 1.9.3p194 :003 > f.__id__ => 80452110 1.9.3p194 :004 > f.reopen(STDOUT) => #> 1.9.3p194 :005 > f.class => IO 1.9.3p194 :006 > f.__id__ => 80452110 You see, an object(id:80452110) changes its class from File to IO. Is it ok? -- http://bugs.ruby-lang.org/