boB Stepp <robertvst...@gmail.com> writes:

> So the impression I am getting is that a function name by itself (with
> no parentheses) is the function *object*.

Yes. The expression ‘func’ resolves to whatever object is referenced by
that name; if it's a function object, you get that object.

The expression ‘func(foo, bar)’ resolves to whatever object is returned
from *calling* the object ‘func’, with the arguments ‘foo, bar’.

> But why does Python require separating the function object from its
> parameters when it is being passed as an argument to another function?

You've already answered your question. An expression resolves to exactly
one object. Either you want the function object, or you want something
else.

In the case of ‘func(foo, bar)’ you will get exactly one object from
that expression. You won't get the ‘func’ object as well; you need a
different expression (the expression ‘func’) to get that.

If you want to talk about different objects at the same time, you need
multiple parameters in which to place those objects.

-- 
 \      “By instructing students how to learn, unlearn, and relearn, a |
  `\         powerful new dimension can be added to education.” —Alvin |
_o__)                                    Toffler, _Future Shock_, 1970 |
Ben Finney

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to