[ruby-core:121804] [Ruby Bug#21302] Remove or Fix Set#to_h

Issue #21302 has been reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Bug #21302: Remove or Fix Set#to_h https://bugs.ruby-lang.org/issues/21302 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- When backwards-compatible marshalling support for Set was added in commit:926411171d296859839745a536aa86bc1e18aa76, Set#to_h was added. I'm not sure if intentionally or accidentally (@nobu knows). The method is not backwards compatible with the previous Set#to_h method (Enumerable#to_h), so it should be fixed or removed. Since it is a new method added to a core class, it should be officially approved if we want to keep it. I would prefer removing it. Users that want a `true`-valued hash can use `to_h { [it, true] }` instead of `to_h`. I have submitted a pull request to remove it: https://github.com/ruby/ruby/pull/13247 However, if we want to keep it, we should fix it to be backwards compatible and add tests and documentation. I have submitted a pull request for that as well: https://github.com/ruby/ruby/pull/13248 -- https://bugs.ruby-lang.org/

Issue #21302 has been updated by byroot (Jean Boussier). I think you can just remove it. I used it in Pysch because it was there, if it wasn't intended to be added, just remove it and psych will use something else. ---------------------------------------- Bug #21302: Remove or Fix Set#to_h https://bugs.ruby-lang.org/issues/21302#change-112880 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- When backwards-compatible marshalling support for Set was added in commit:926411171d296859839745a536aa86bc1e18aa76, Set#to_h was added. I'm not sure if intentionally or accidentally (@nobu knows). The method is not backwards compatible with the previous Set#to_h method (Enumerable#to_h), so it should be fixed or removed. Since it is a new method added to a core class, it should be officially approved if we want to keep it. I would prefer removing it. Users that want a `true`-valued hash can use `to_h { [it, true] }` instead of `to_h`. I have submitted a pull request to remove it: https://github.com/ruby/ruby/pull/13247 However, if we want to keep it, we should fix it to be backwards compatible and add tests and documentation. I have submitted a pull request for that as well: https://github.com/ruby/ruby/pull/13248 -- https://bugs.ruby-lang.org/

Issue #21302 has been updated by nobu (Nobuyoshi Nakada). I agree to remove it. ---------------------------------------- Bug #21302: Remove or Fix Set#to_h https://bugs.ruby-lang.org/issues/21302#change-112887 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- When backwards-compatible marshalling support for Set was added in commit:926411171d296859839745a536aa86bc1e18aa76, Set#to_h was added. I'm not sure if intentionally or accidentally (@nobu knows). The method is not backwards compatible with the previous Set#to_h method (Enumerable#to_h), so it should be fixed or removed. Since it is a new method added to a core class, it should be officially approved if we want to keep it. I would prefer removing it. Users that want a `true`-valued hash can use `to_h { [it, true] }` instead of `to_h`. I have submitted a pull request to remove it: https://github.com/ruby/ruby/pull/13247 However, if we want to keep it, we should fix it to be backwards compatible and add tests and documentation. I have submitted a pull request for that as well: https://github.com/ruby/ruby/pull/13248 -- https://bugs.ruby-lang.org/

Issue #21302 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed Fixed by commit:203199251f723d02f23f5782523d16f91277ea82 ---------------------------------------- Bug #21302: Remove or Fix Set#to_h https://bugs.ruby-lang.org/issues/21302#change-113183 * Author: jeremyevans0 (Jeremy Evans) * Status: Closed * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- When backwards-compatible marshalling support for Set was added in commit:926411171d296859839745a536aa86bc1e18aa76, Set#to_h was added. I'm not sure if intentionally or accidentally (@nobu knows). The method is not backwards compatible with the previous Set#to_h method (Enumerable#to_h), so it should be fixed or removed. Since it is a new method added to a core class, it should be officially approved if we want to keep it. I would prefer removing it. Users that want a `true`-valued hash can use `to_h { [it, true] }` instead of `to_h`. I have submitted a pull request to remove it: https://github.com/ruby/ruby/pull/13247 However, if we want to keep it, we should fix it to be backwards compatible and add tests and documentation. I have submitted a pull request for that as well: https://github.com/ruby/ruby/pull/13248 -- https://bugs.ruby-lang.org/
participants (3)
-
byroot (Jean Boussier)
-
jeremyevans0 (Jeremy Evans)
-
nobu (Nobuyoshi Nakada)