Please help with MemoryError

Steve Holden steve at holdenweb.com
Fri Feb 12 18:26:57 EST 2010


Gib Bogle wrote:
> 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
> 
Yes, and it will doubtless be subject to exactly the same bogus refutations.

regards
 Steve
-- 
Steve Holden           +1 571 484 6266   +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010  http://us.pycon.org/
Holden Web LLC                 http://www.holdenweb.com/
UPCOMING EVENTS:        http://holdenweb.eventbrite.com/




More information about the Python-list mailing list