Project

General

Profile

Actions

Feature #17210

open

More readable and useful `Set#inspect`

Added by marcandre (Marc-Andre Lafortune) over 3 years ago. Updated 25 days ago.

Status:
Assigned
Target version:
-
[ruby-core:100276]

Description

I would like to change Set#inspect/to_s:

# before
puts Set[1,2,3] # => "#<Set: {1, 2, 3}>"

# after
puts Set[1,2,3] # => "Set[1, 2, 3]"

This output is shorter, readable, and has the property that it corresponds to Ruby code

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0