[Tutor] 'in-place' methods

Terry Carroll carroll at tjc.com
Sat Feb 18 23:05:51 CET 2006


On Fri, 17 Feb 2006, Kent Johnson wrote:

> Ruby has an interesting approach to this - the names of mutating methods 
> end with !. So it would be list.sort!() which gives a strong cue to what 
> is happening.

What a great idea!  Hmm.. maybe Python could do this, too; and use some
other characters like $, @ and % to indicate if a name is a reference to a
plain old variable, a list, or a dictionary!




More information about the Tutor mailing list