Issue #16356 has been updated by shevegen (Robert A. Heiler).


> But names (e.g. literal :* and :&) should be excluded from parameters output anyways, right?

I am not matz, nor among the core team, but I think that the general intention is that the
information displayed here (e. g. via #inspect) should be useful to the user, to some extent;
and ideally consistent/uniform whenever possible.

As Kazuhiro showed, the display is like:

    #<Method: main.mf(**, &&) -e:1>

And I am not sure if this is that helpful for ruby users. It is also a bit strange that
-e:1 is passed. I can not imagine that this is very useful to anyone. :) This is from
the commandline, yes? I remember having that sometimes when invoking ruby scripts or
e. g. calling a custom method in some .rb file.

So, no matter whether there may be reasons behind the display, I think Kazuhiro's question
is a good one either way how you look at this. (Actually what may be missing in the
issue description is to say what should otherwise be shown, rather than the current
"main.mf(**, &&) -e:1". I guess one could also show more information if wanted or
necessary, such as to indicate that it may be a forwarded-message. Perhaps matz or
nobu may know what might fit best here.)

> So the current behavior omitting :keyrest makes sense.

I think this is only one part; the other is whether this is very useful for ruby 
users. Kazuhiro did not explicitely mention this, but I think the current display
is a bit weird.

----------------------------------------
Feature #16356: Method#inspect of argument forwarding
https://bugs.ruby-lang.org/issues/16356#change-82747

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Current behavior includes `(**, &&)`.
Is this intentional?

```
% ruby -e 'def mf(...);end;p method(:mf)'
#<Method: main.mf(**, &&) -e:1>
```

I added tests of current behavior at https://github.com/ruby/ruby/commit/777973084e599cf9efa490173709b187fb507f90



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>