[#119637] Behavior of raising from rescue blocks when multiple rescue blocks exist — Rodrigo Rosenfeld Rosas via ruby-core <ruby-core@...>
Hello, I couldn't find any documentation about the subject, so I thought
3 messages
2024/10/29
[ruby-core:119434] [Ruby master Bug#20433] Hash.inspect for some hash returns syntax invalid representation
From:
"byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Date:
2024-10-03 15:49:36 UTC
List:
ruby-core #119434
Issue #20433 has been updated by byroot (Jean Boussier).
@tompng @mame what is the status on this? I see https://github.com/ruby/ruby/pull/10924 has been merged, should this ticket be closed?
I personally love this change, but I have a lot of tests to update as a result, so I'd like to know if this is certain this change will be part of 3.4.0 before I start the work of fixing it all.
----------------------------------------
Bug #20433: Hash.inspect for some hash returns syntax invalid representation
https://bugs.ruby-lang.org/issues/20433#change-110054
* Author: tompng (tomoya ishida)
* Status: Open
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
For these hashes, Hash.inspect returns a syntax invalid representation:
~~~ruby
{ :a! => 1 } # {:a!=>1}
{ :a? => 1 } # {:a?=>1}
{ :* => 1 } # {:*=>1}
{ :== => 1 } # {:===>1}
{ :< => 1 } # {:<=>1}
~~~
`eval(hash.inspect)` will raise SyntaxError.
Although inspect does not guarantee that the result can be eval-ed, it'd be confusing for these few cases.
Maybe related to https://bugs.ruby-lang.org/issues/20235
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/