Issue #17745 has been updated by Eregon (Benoit Daloze).


Is there any reason to call close_on_exec= with `send/__send__`, or to use its return value?

I would be on the side of "changing this should not hurt", but it seems other committers do not necessarily agree (I guess their point is code should not rely on that anyway).

----------------------------------------
Feature #17745: `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not
https://bugs.ruby-lang.org/issues/17745#change-92732

* Author: kachick (Kenichi Kamiya)
* Status: Open
* Priority: Normal
----------------------------------------
```console
$ ruby -v -e 'p(STDIN.close_on_exec = 42)'
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
42
```

```console
$ ruby -v -e 'p(STDIN.__send__ :close_on_exec=, 42)'
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
nil
```

Is this an intentional behavior?
`ruby/spec` has the test case, But I can't think any benefit this different returning value   

PR: https://github.com/ruby/ruby/pull/4321



-- 
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>