What is a function parameter =[] for?

Marko Rauhamaa marko at pacujo.net
Tue Nov 24 13:13:22 EST 2015


Ned Batchelder <ned at nedbatchelder.com>:

> Oscar, thanks for the thoughtful comments. I agree that using "object"
> for the result of an expression, and for the referent of a name, would
> go some ways to clarifying things.
>
> Perhaps the Python world uses "value" less to mean "object" than I am
> thinking. But we do talk about "the value of an expression", and "what
> value does X have," and so on.

There are all kinds of uses (Google: python "value of"):

  "How to get the value of a variable given its name in a string"

  "The value of some objects can change. Objects whose value can change
  are said to be mutable"

  "I'm taking the return value of one function and using it as the
  argument of another function"

  "Don't get confused — name on the left, value on the right"

  "We can print the current value of the dictionary in the usual way"

  "A return statement ends the execution of the function call and
  "returns" the result, i.e. the value of the expression following the
  return keyword, to the caller"

  "When we ask python what the value of x > 5 is, we get False"

  "To display the value of a variable, you can use a print statement"

  "Get a value of a specified key"


Personally, I don't like the "official" Python usage:

   Objects whose value can change are said to be mutable

I would prefer this wording:

   Objects whose inner state can change are said to be mutable


Marko



More information about the Python-list mailing list