On 26/05/07, Urabe Shyouhei <shyouhei / ruby-lang.org> wrote:
> Hi,
>
> Urabe Shyouhei wrote:
> > Calamitas wrote:
> >
> >> Seems like the issue reported in [ruby-talk:248647] has not been
> >> resolved yet in the ruby_1_8 branch. I've attached the patch again.
> >>
> >
> > Thank you, I was not aware of this thread.
> >
>
> I've adopted your patch for Object#method into both ruby_1_8_6 and
> ruby_1_8_5 branches, but not for Method#inspect, as that did not seem
> like a logical bug to me.  Discussions are welcomed. And wait knu
> (ruby_1_8 branch manager) for its adoption for ruby 1.8.7 and above.

Method#inspect had no bug that I'm aware of; I only changed it to
preserve its behavior. Building on the example of the OP in
[ruby-talk:248647]:

  # Before the patch
      Baz.new.method(:boo).inspect  #=>  "#<Method: Baz(Bar)#boo>"
  # After the patch to only Object#method
      Baz.new.method(:boo).inspect  #=>  "#<Method: Baz(Foo)#boo>"
  # After the patch to both Object#method and Method#inspect
      Baz.new.method(:boo).inspect  #=>  "#<Method: Baz(Bar)#boo>"

The method is really defined in Bar, not in Foo. A difference in the
inspect string may not seem like a big deal, but people may rely on
it, for instance to retrieve the defining class or module.

Peter