* [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
@ 2021-03-20 6:33 kachick1
2021-03-20 8:52 ` [ruby-core:102960] " nobu
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: kachick1 @ 2021-03-20 6:33 UTC (permalink / raw)
To: ruby-core
Issue #17735 has been reported by kachick (Kenichi Kamiya).
----------------------------------------
Bug #17735: `Hash#transform_keys!` drops non evaluated keys
https://bugs.ruby-lang.org/issues/17735
* 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
----------------------------------------
```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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:102960] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
2021-03-20 6:33 [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys kachick1
@ 2021-03-20 8:52 ` nobu
2021-03-28 9:55 ` [ruby-core:103070] " nagachika00
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2021-03-20 8:52 UTC (permalink / raw)
To: ruby-core
Issue #17735 has been updated by nobu (Nobuyoshi Nakada).
These are just a bug, not a spec.
```ruby
ruby_version_is ""..."2.5.1" do
it "partially modifies the contents if we broke from the block" do
@hash.transform_keys! do |v|
break if v == :c
v.succ
end
@hash.should == { c: 1, d: 4 }
end
end
ruby_version_is "2.5.1" do
it "returns the processed keys if we broke from the block" do
@hash.transform_keys! do |v|
break if v == :c
v.succ
end
@hash.should == { b: 1, c: 2 }
end
end
```
----------------------------------------
Bug #17735: `Hash#transform_keys!` drops non evaluated keys
https://bugs.ruby-lang.org/issues/17735#change-91023
* 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
----------------------------------------
```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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:103070] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
2021-03-20 6:33 [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys kachick1
2021-03-20 8:52 ` [ruby-core:102960] " nobu
@ 2021-03-28 9:55 ` nagachika00
2021-04-15 1:29 ` [ruby-core:103454] " nagachika00
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: nagachika00 @ 2021-03-28 9:55 UTC (permalink / raw)
To: ruby-core
Issue #17735 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN to 2.5: UNKNOWN, 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
I have confirmed that the issue is reproducible on 2.6/2.7 too.
----------------------------------------
Bug #17735: `Hash#transform_keys!` drops non evaluated keys
https://bugs.ruby-lang.org/issues/17735#change-91133
* Author: kachick (Kenichi Kamiya)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
----------------------------------------
```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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:103454] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
2021-03-20 6:33 [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys kachick1
2021-03-20 8:52 ` [ruby-core:102960] " nobu
2021-03-28 9:55 ` [ruby-core:103070] " nagachika00
@ 2021-04-15 1:29 ` nagachika00
2021-09-14 10:24 ` [ruby-core:105249] " nagachika (Tomoyuki Chikanaga)
2021-09-18 7:51 ` [ruby-core:105337] " nagachika (Tomoyuki Chikanaga)
4 siblings, 0 replies; 6+ messages in thread
From: nagachika00 @ 2021-04-15 1:29 UTC (permalink / raw)
To: ruby-core
Issue #17735 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.5: UNKNOWN, 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.5: UNKNOWN, 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
ruby_3_0 84d9a9afc0b49d095541acb9832f8b12fb506e19 merged revision(s) 31e0382723bfb35cffe3ca485dd0577668cafa07,5e5fb72f99701dc27c66ab148471893f14e6d6f0,fb6ebe55d91187d9635e0183d47dbf38e95b1141,522d4cd32f7727886f4fcbc28ed29c08d361ee20.
----------------------------------------
Bug #17735: `Hash#transform_keys!` drops non evaluated keys
https://bugs.ruby-lang.org/issues/17735#change-91549
* Author: kachick (Kenichi Kamiya)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:105249] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
2021-03-20 6:33 [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys kachick1
` (2 preceding siblings ...)
2021-04-15 1:29 ` [ruby-core:103454] " nagachika00
@ 2021-09-14 10:24 ` nagachika (Tomoyuki Chikanaga)
2021-09-18 7:51 ` [ruby-core:105337] " nagachika (Tomoyuki Chikanaga)
4 siblings, 0 replies; 6+ messages in thread
From: nagachika (Tomoyuki Chikanaga) @ 2021-09-14 10:24 UTC (permalink / raw)
To: ruby-core
Issue #17735 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.5: UNKNOWN, 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
522d4cd32f7727886f4fcbc28ed29c08d361ee20 was reverted at bb84c75001f1bf13b4b2a12db8f4420e76a3ea03. Should I backport it into ruby_3_0?
----------------------------------------
Bug #17735: `Hash#transform_keys!` drops non evaluated keys
https://bugs.ruby-lang.org/issues/17735#change-93658
* 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: REQUIRED
----------------------------------------
```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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:105337] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys
2021-03-20 6:33 [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys kachick1
` (3 preceding siblings ...)
2021-09-14 10:24 ` [ruby-core:105249] " nagachika (Tomoyuki Chikanaga)
@ 2021-09-18 7:51 ` nagachika (Tomoyuki Chikanaga)
4 siblings, 0 replies; 6+ messages in thread
From: nagachika (Tomoyuki Chikanaga) @ 2021-09-18 7:51 UTC (permalink / raw)
To: ruby-core
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-09-18 7:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20 6:33 [ruby-core:102949] [Ruby master Bug#17735] `Hash#transform_keys!` drops non evaluated keys kachick1
2021-03-20 8:52 ` [ruby-core:102960] " nobu
2021-03-28 9:55 ` [ruby-core:103070] " nagachika00
2021-04-15 1:29 ` [ruby-core:103454] " nagachika00
2021-09-14 10:24 ` [ruby-core:105249] " nagachika (Tomoyuki Chikanaga)
2021-09-18 7:51 ` [ruby-core:105337] " nagachika (Tomoyuki Chikanaga)
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).