Can global variable be passed into Python function?

Marko Rauhamaa marko at pacujo.net
Fri Feb 21 07:52:45 EST 2014


Ned Batchelder <ned at nedbatchelder.com>:

> Man, do I hate this idea that Python has no variables. It has
> variables (names associated with values, and the values can change
> over the course of the program),

In classic functional programming, the values of variables can't change
but they are still called variables (even though "parameters" might be
more fitting).

> they just don't work the same as C or Fortran variables. In fact, they
> work exactly the same as Javascript or Ruby variables.

Apart from a fact that a C variable has an address (references are
first-class objects, if you will), I really don't see a difference
between a C variable and a Python variable.


Marko



More information about the Python-list mailing list