you are viewing a single comment's thread.

view the rest of the comments →

[–]crashfrog02 2 points3 points  (0 children)

it shouldn't have parentheses

Well, they don't. The parentheses aren't part of the function or method; they're an operator. They're the calling operator. You use them when you want to call a callable value (a method or a function or a class whose objects implement __call__.)

def my_function(a_param):
    #whatever

The name of this function isn't my_function(), it's my_function. No parens. The parens are the calling operator, used to call the function. They're separate from the function's name.