[Python-ideas] Default arguments in Python - the return - running out of ideas but...

CTO debatem1 at gmail.com
Fri May 15 06:48:53 CEST 2009


[super-snip]
> Just out of curiosity, what do you see as the drawbacks?
[snip]

1) It adds to the complexity (and therefore overhead) of
   calling functions- not just the functions which use it,
   but even functions which operate as normal. Python
   already has a hefty penalty for calling functions, and
   I really don't want it to get any heavier. My 'solutions',
   as incomplete as they are, at least don't slow down
   anything else.
2) It adds to the complexity of introspecting functions.
   Take a good look at inspect.getfullargspec- its a
   nightmare, and either it gets worse under this (bad)
   or it doesn't include information that is available
   to the compiler (even worse).

In addition to those minuses, it doesn't actually add
to the capabilities of the language. If this were a
proposal to add early action to Python (the equivalent
of metaclasses or, to some extent, macro replacement)
I would be much more likely to support it, despite the
heavier syntax.

So, the existing idiom works pretty well, there
doesn't seem to be a very good substitute, it slows
the whole language down to implement, and it doesn't
add any power if you do.

Like I say, I'm unconvinced.

Geremy Condra



More information about the Python-ideas mailing list