Please help with MemoryError

Gib Bogle g.bogle at auckland.no.spam.ac.nz
Fri Feb 12 18:18:48 EST 2010


Steven D'Aprano wrote:

> def swap(a, b):
>     a, b = b, a
> 
> x = 1
> y = 2
> swap(x, y)
> assert (x == 2) and (y==1)

Can't the same point be more simply made with this example:

def setval(a):
     a = 12345

x = 1
setval(x)
print x

?



More information about the Python-list mailing list