passing by refference

Brian Quinlan brian at sweetapp.com
Tue May 13 13:44:55 EDT 2003


> is passing by reffence possible in python?

In the sense that you mean, no.

It is hard to say exactly what idiom you want, since your example is
clearly contrived. It is possible to write a function such as this:

def spam(*args):
    # process args in some way
    return args

bacon, egg = spam(bacon, egg)

Cheers,
Brian






More information about the Python-list mailing list