2 Jan
2013
2 Jan
'13
12:12 a.m.
On Wed, Jan 2, 2013 at 6:29 PM, Antoine Pitrou
Let's call them a compromise then, but calling them a language feature sounds delusional. I can't remember ever taking advantage of the fact that mutable default arguments are shared accross function invocations.
One common use is caching, as I mentioned earlier (with a contrived example). Another huge benefit is efficiency - construct a heavy object once and keep using it. There are others. It's a feature that can bite people, but no less a feature for that. ChrisA