[Python-ideas] function defaults and an empty() builtin

Greg Ewing greg.ewing at canterbury.ac.nz
Sat May 21 06:10:55 CEST 2011


Masklinn wrote:

> Absolutely, but the mutation of the default parameters seems to be the main
> problem (historically):

The most common problem regarding default parameters is mutation
of them by functions which *are* supposed to modify the parameter.

IMO you're trying to solve an almost-nonexistent problem.

> it's a global data corruption,
> where modifying a provided parameter is a local data corruption

It's just as damaging, though -- the program still produces
incorrect results.

-- 
Greg



More information about the Python-ideas mailing list