"pass by reference?"

F. GEIGER fgeiger at datec.at
Sat Feb 23 06:55:00 EST 2002


a= abs(a)

Cheers Franz

"Tripp Scott" <tripps81 at yahoo.com> schrieb im Newsbeitrag
news:mailman.1014452738.24147.python-list at python.org...
> Suppose I want to make a function that modifies its argument:
>
>   a = -1
>   make_abs(a)
>   print a # = 1
>
> What is the Pythonic way of doing this? Wrap it in a list?
>
>   make_abs([a])
>
> t
>
>





More information about the Python-list mailing list