Why I chose Python over Ruby

Roy Smith roy at panix.com
Mon Mar 6 01:48:06 CET 2006


Xavier Morel <xavier.morel at masklinn.net> wrote:

> Francois wrote:
> > 1) In Ruby there is a risk of "Variable/Method Ambiguity" when calling
> > a method with no parameters without using () :
> > 
> Yes, but that's in my opinion a programmer error, not necessarily a 
> language error.

In Python, you can make exactly the opposite error.  Both of these are 
perfectly legal and reasonable things to write, where foo is a function:

   a = foo
   a = foo()

Actually, if you want to have a little fun, try:

   def foo:
      return foo

then you can write:

   a = foo
   a = foo()
   a = foo()()
   a = foo()()()
   a = foo()()()()
   etc.



More information about the Python-list mailing list