matz / ruby-lang.org (Yukihiro Matsumoto) writes:

> Hi,
> 
> In message "Re: [FAQ] Defining <=>"
>     on 02/11/25, ts <decoux / moulon.inra.fr> writes:
> 
> | Well, you can remove it from the FAQ but you'll never stop ruby to do this 
> |
> |pigeon% ruby -e 'File.open([])'
> |-e:1:in `open': wrong argument type Array (expected String) (TypeError)
> |        from -e:1
> 
> But it based on whether object has "to_str" or not.

Actually, File.open looks for a String, it just calls
rb_check_safe_str. Arguably to should use to_str, though.

Cheers


Dave