On Sat, Dec 11, 2021 at 9:43 AM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote:
On 2021-12-10 at 17:24:22 -0500, "Eric V. Smith" <eric@trueblade.com> wrote:
[0]: Or arguments, I can never remember which is which: someone needs to invent a memorable mnemonic device.
Pass Arguments Accept Parameters
(I don't know. I just made that up. For some reason, the fact that functions have "formal parameters" stuck with me (to me?) from somewhere, and then I can put the pieces together to figure out where the arguments must come from. And you can't unsee it now; sorry.)
Formal parameters are the placeholders - the variable names that receive values. Arguments or "actual parameters" are what got used when the function got called. An optional parameter can have a default argument which is used when there is no argument passed. In some languages, a parameter can be optional without a default, in which case it won't have a value, but in current Python, defaults and optionality always go together. Whether 'self' counts as a parameter, and whether the object to the left of the dot counts as an argument, depends on your point of view. :) ChrisA