Why python can't omit parentheses in a function call just like some other language(coffeescript haskell) do? Just some historical reason or what?
2 Answers
7
votes
The parentheses allow us to disambiguate the function object, func, from the calling of the function, func().
Function objects are first-class objects in Python. You can, for instance, pass them as arguments to functions, just like any other object. This is often used to set a callback function -- a common practice in GUI programming or concurrent programming.
import this), "There should be one-- and preferably only one --obvious way to do it." - jonrsharpeprintis a statement in that version, not a function. - jonrsharpe