Mauricio Fernandez schrieb:
> Open is a singleton method of IO, not File; this is why the call fails (in
> 1.9, it'd happen earlier, as soon as you try to rebind the method).  There's
> nothing that special about File itself:
> (...)

The problem is, if you change the method of the superclass (IO), and 
then later restore the original version, that you can't call it on the 
subclass (File):

   class X; def self.foo; 1 end end
   class Y < X; end

   Y.foo  # => 1

   m = X.method(:foo)
   def X.foo; 2 end

   Y.foo  # => 2

   class << X; self end.class_eval{define_method(:foo, m)}

   X.foo  # => 1
   Y.foo  # => singleton method called for a different object

Do you know why this happens?

Regards,
Pit