From: shevegen@... Date: 2017-06-23T15:55:33+00:00 Subject: [ruby-core:81757] [Ruby trunk Feature#13676] to_s method is not overriden for Set Issue #13676 has been updated by shevegen (Robert A. Heiler). I have no pro or con opinion. I did however had want to compare Set to Array and the two behave differently. require 'pp' require 'set' s1 = Set.new s1<<'tic'<<'tac' puts s1.to_s pp s1 array = Array.new array << 'tic' << 'tac' puts array.to_s pp array # Output: # # # # ["tic", "tac"] # ["tic", "tac"] I have no idea why Set behaves that way, perhaps there is a clear reason. I can however had understand razor too - without knowing the context or really having a lot of experience with Set mayself, to me the behaviour of Array seems "more useful" by default. But again, I have no real idea about this so neither can I say good or bad if it would be changed - I really don't know. I only use Arrays, barely ever Set myself. :) ---------------------------------------- Feature #13676: to_s method is not overriden for Set https://bugs.ruby-lang.org/issues/13676#change-65454 * Author: razor (Marat Chardymov) * Status: Feedback * Priority: Normal * Assignee: * Target version: ---------------------------------------- When I call ~~~ ruby s1 = Set.new s1<<'tic'<<'tac' s1.to_s ~~~ I'd expect ['tic', 'tac'] values being printed, not "#" -- https://bugs.ruby-lang.org/ Unsubscribe: