function without brackets ?

Kay Schluehr kay.schluehr at gmx.net
Wed Jan 3 09:50:13 EST 2007


Stef Mientki schrieb:

> If I call a parameterless function without brackets at the end,
> the function is not performed, but ...
> I don't get an error message ???
>
> Is this normal  behavior ?

Yes, this is perfectly o.k. because each function is a first class
citizen in Python. The difference between foo() and foo is simply that
foo() is the value returned by the function call on foo and foo is a
function object. 

Kay




More information about the Python-list mailing list