> is, I think you've hit on the answer:  the default, if you will, is to 
> perform operations in-place, to avoid the necessity of reassigning a 
> list to it's sorted version, to give one example.  

But that isn't necessary, you could just return a reference to the 
sorted list, that is:

x = L.sort()

is identical to

L.sort()
x = L

That is quite resource efficient and allows things l;ike

print L.sort()

This is the default technique in SmallTalk methods, 
if you don't know what else to return then return self
It's a pretty good default rule IMHO.

Alan G.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to