From: murphy Date: 2007-11-13T04:54:59+09:00 Subject: Re: Time#== bug? Jim Weirich wrote: > On Nov 12, 2007, at 12:09 PM, Berger, Daniel wrote: >> Looks like Time#== always returns nil when compared against an invalid >> type. All the other Comparable operators return an ArgumentError: > I don't think it should ever be an error to ask if an object is equal to > any other object. Nil (or false) would be the correct response in the > example you gave. not all Comparable operators: the funny thing is that Time.now <=> 0 returns nil, too...I would expect it to throw an error. but "" <=> :foo and 4.3 <=> // also return nil, so I guess it's by design. [murphy]