Please help with MemoryError

Gregory Ewing greg.ewing at canterbury.ac.nz
Fri Feb 12 19:55:46 EST 2010


Antoine Pitrou wrote:

> It's just that assignment ("=") means a different thing in Python than in 
> non-object languages (or fake-object languages such as C++ or PHP): it 
> rebinds instead of mutating in-place.  If it mutated, you wouldn't have
> the AssertionError.

It doesn't really have anything to do with assignment semantics.
The essence of pass-by-reference is that the formal parameter
name becomes an alias for the actual parameter in all respects.
Whatever the semantics of assignment, you can come up with
variations of the language that either do or don't support
pass-by-reference in this sense. It's an orthogonal issue.

-- 
Greg



More information about the Python-list mailing list