Pass by reference

alex goretoy aleksandr.goretoy at gmail.com
Fri Jan 2 21:05:49 EST 2009


You are correct, terminology is a must. In order to stay on the same page.
And yes, it;s not technically by ref. but it works for me at the moment.

I was doing this in my code:
l={"user":"asdf","pass":"goog"}
d= {
    "login_url":"http://example.com/login",
    "user":l["user"],
    "pass":l["pass"]

}
and it wouldn't work. So I had to do some research on how to make it work.
passing a mutable object resolved my problem. Thank you for correcting me.
-A


On Thu, Jan 1, 2009 at 6:22 PM, Terry Reedy <tjreedy at udel.edu> wrote:

> alex goretoy wrote:
>
>> I recently conquered this pass by ref thing. This is how I did it.
>>
>
> What you did was to pass a mutable object and mutate it.  Absolutely
> standard practice in Python.  I am glad you learned it, but also learning
> and using the standard terminology will also help.  Hope you enjoy Python
> too.
>
> tjr
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090103/aef3a8f4/attachment.html>


More information about the Python-list mailing list