Please help with MemoryError

Gib Bogle g.bogle at auckland.no.spam.ac.nz
Sat Feb 13 00:18:48 CET 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