ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:102998] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not
@ 2021-03-24 16:22 kachick1
  2021-03-24 19:39 ` [ruby-core:103001] " eregontp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kachick1 @ 2021-03-24 16:22 UTC (permalink / raw
  To: ruby-core

Issue #17745 has been reported by kachick (Kenichi Kamiya).

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

* Author: kachick (Kenichi Kamiya)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
```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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:103001] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not
  2021-03-24 16:22 [ruby-core:102998] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not kachick1
@ 2021-03-24 19:39 ` eregontp
  2021-03-24 21:02 ` [ruby-core:103004] " nobu
  2021-07-02 15:39 ` [ruby-core:104473] [Ruby master Feature#17745] " eregontp
  2 siblings, 0 replies; 4+ messages in thread
From: eregontp @ 2021-03-24 19:39 UTC (permalink / raw
  To: ruby-core

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


The PR looks good to me.

As you may know `recv.foo= value` always return `value`, no matter what the `foo=` method returns.
So in general the return value of assignment methods might differ and is probably best to be ignored.

----------------------------------------
Bug #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-91064

* Author: kachick (Kenichi Kamiya)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
```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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:103004] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not
  2021-03-24 16:22 [ruby-core:102998] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not kachick1
  2021-03-24 19:39 ` [ruby-core:103001] " eregontp
@ 2021-03-24 21:02 ` nobu
  2021-07-02 15:39 ` [ruby-core:104473] [Ruby master Feature#17745] " eregontp
  2 siblings, 0 replies; 4+ messages in thread
From: nobu @ 2021-03-24 21:02 UTC (permalink / raw
  To: ruby-core

Issue #17745 has been updated by nobu (Nobuyoshi Nakada).


I also think the "returns nil" example should be removed simply.

----------------------------------------
Bug #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-91067

* Author: kachick (Kenichi Kamiya)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
```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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:104473] [Ruby master Feature#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not
  2021-03-24 16:22 [ruby-core:102998] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not kachick1
  2021-03-24 19:39 ` [ruby-core:103001] " eregontp
  2021-03-24 21:02 ` [ruby-core:103004] " nobu
@ 2021-07-02 15:39 ` eregontp
  2 siblings, 0 replies; 4+ messages in thread
From: eregontp @ 2021-07-02 15:39 UTC (permalink / raw
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-02 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-24 16:22 [ruby-core:102998] [Ruby master Bug#17745] `IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not kachick1
2021-03-24 19:39 ` [ruby-core:103001] " eregontp
2021-03-24 21:02 ` [ruby-core:103004] " nobu
2021-07-02 15:39 ` [ruby-core:104473] [Ruby master Feature#17745] " eregontp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).