osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can global variable be passed into Python function?


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