On Sat, 13 Nov 2010 14:37:44 -0800, Dennis Lee Bieber wrote: > On Sat, 13 Nov 2010 16:29:19 +0000, m...@distorted.org.uk (Mark Wooding) > declaimed the following in gmane.comp.python.general: > > >> to a function argument /never/ affects the caller in Python. It's >> simply not possible to write a `swap' function in Python. The latter >> means that a value itself changes but the relevant variables continue >> to store the same values. >> > I disagree (borrowing FORTRAN and Ada terms)... > > You can not write a "swap" PROCEDURE in Python... PROCEDUREs do not > return values except via side-effects on the arguments. FUNCTIONs > however, do return values as the function result...
Ha, excellent point! But in fairness, in context he was talking about a function that operates purely by side-effects -- what Pascal, Fortran or Ada would call a procedure. -- Steven -- http://mail.python.org/mailman/listinfo/python-list