[Python-ideas] Default arguments in Python - the return

Aahz aahz at pythoncraft.com
Mon May 11 14:29:54 CEST 2009


On Mon, May 11, 2009, Tennessee Leeuwenburg wrote:
> On Sun, May 10, 2009 at 11:23 AM, Steven D'Aprano <steve at pearwood.info>wrote:
>> 
>> (1) Assignments outside of the body of a function happen once, at
>> compile time. Default values are outside the body of the function. You
>> want a special case for default values so that they too happen at
>> runtime. That's not special enough to warrant breaking the rules.
> 
> Your logic is impeccable :) ... yet, if I may continue to push my
> wheelbarrow uphill for a moment longer, I would argue that is an
> implementation detail, not a piece of design philosophy.

I'm not going to look it up, but in the past, Guido has essentially
claimed that this behavior is by design (not so much by itself but in
conjunction with other deliberate decisions).  I remind you of this:

"Programming language design is not a rational science. Most reasoning
about it is at best rationalization of gut feelings, and at worst plain
wrong."  --GvR, python-ideas, 2009-3-1
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan


More information about the Python-ideas mailing list