"pass by reference?"

Greg Weeks weeks at vitus.scs.agilent.com
Sat Feb 23 19:02:41 EST 2002


Tripp Scott (tripps81 at yahoo.com) wrote:

: Suppose I want to make a function that modifies its argument:  ..
: What is the Pythonic way of doing this?

The Python way is to train yourself not to want such things.

As is often the case, the Python way is the correct way.  It is easier to
read code if you don't have to wonder whether f(x) rebinds x.

Greg



More information about the Python-list mailing list