Long strings as function parameters

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Sun Jan 9 11:52:25 EST 2005


onlyonemc at gmail.com wrote:
> I would like to have functions that operate on long strings, 10-100 MB.
> In C I would of course pass a pointer to the string for a quick
> function call.  What is an efficient way to do this in python?

Err, just pass the string to the function?
In Python, all function arguments are passed by (object)reference.
So if you are afraid that Python passes your 50Mb string object
/by value/ (thus creating a copy): it doesn't.

--Irmen



More information about the Python-list mailing list