[#105450] [Ruby master Feature#18228] Add a `timeout` option to `IO.copy_stream` — "byroot (Jean Boussier)" <noreply@...>
SXNzdWUgIzE4MjI4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGJ5cm9vdCAoSmVhbiBCb3Vzc2llciku
11 messages
2021/09/27
[ruby-core:105337] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
From:
"nagachika (Tomoyuki Chikanaga)" <noreply@...>
Date:
2021-09-18 07:51:17 UTC
List:
ruby-core #105337
Issue #17735 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
Additionally backported bb84c75001f1bf13b4b2a12db8f4420e76a3ea03 into ruby_3_0 at 98ac62de5cb03efec0fb32684c61c0d4df692e5a.
----------------------------------------
Bug #17735: `Hash#transform_keys!` drops non evaluated keys
https://bugs.ruby-lang.org/issues/17735#change-93751
* Author: kachick (Kenichi Kamiya)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
----------------------------------------
```ruby
hash = {a: 1, b: 2, c: 3}
hash.transform_values!(){ raise } rescue
p hash #=> {:a=>1, :b=>2, :c=>3}
```
```ruby
hash = {a: 1, b: 2, c: 3}
hash.transform_keys!(){ raise } rescue
p hash #=> {}
```
Is this an intentional behavior?
I expected behavior like `transform_values!` in `transform_keys!` (Keeping non evaluated key-value pairs when exiting the block).
PR: https://github.com/ruby/ruby/pull/4294
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>