a Python person's experience with Ruby
Bruno Desthuilliers
bdesth.quelquechose at free.quelquepart.fr
Sat Dec 8 13:44:18 EST 2007
Colin J. Williams a écrit :
> Steve Howell wrote:>
> Thanks for the interesting comparison.
>
> [snip]
>
>> 3) I actually like being able to omit parentheses in
>> method definitions and method calls. In Ruby you can
>> express "add(3,5,7)" as both "add(3,5,7)" and "add 3,
>> 5, 7." The latter syntax is obviously more error
>> prone, but I don't think I've ever actually gotten bit
>> by it, and the code appears more clean to me.
>>
> [snip]
>
> I'm not sure that I like add 3, 5, 7
>
> but it would be nice to be able to drop the parentheses
> when no argument is required.
>
> Thus: close;
> could replace close();
This just could not work given Python's object model. The parens
actually *are* the call operator.
More information about the Python-list
mailing list