functions, list, default parameters

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Tue Nov 2 10:06:40 CET 2010


In message <mailman.481.1288683620.2218.python-list at python.org>, Chris 
Rebert wrote:

> On Fri, Oct 22, 2010 at 12:36 AM, Steven D'Aprano
> <steve at remove-this-cybersource.com.au> wrote:
>>
>> Default mutable arguments have their place
> 
> But it's a rather obscure one where it is almost never strictly
> necessary to venture.

Mediocre programmers with a hankering towards cleverness latch onto it as an 
ingenious way of maintaing persistent context in-between calls to a 
function, completely overlooking the fact that Python offers much more 
straightforward, comprehensible, flexible, and above all maintainable ways 
of doing that sort of thing.



More information about the Python-list mailing list