default value in __init__

Aaron "Castironpi" Brady castironpi at gmail.com
Thu Oct 16 06:43:01 CEST 2008


On Oct 15, 11:33 pm, Steve Holden <st... at holdenweb.com> wrote:
> Aaron "Castironpi" Brady wrote:
>
> [about how default argument behavior should, in his opinion, be changed]
>
> Say what you like. The language is as it is by choice. Were it, for some
> reason, to change we would then be receiving posts every week that
> didn't understand the *new* behavior.
>
> Sometimes people just have to learn to confirm with reality instead of
> requiring reality to confirm with their preconceptions. This is one such
> case.
>
> regards
>  Steve
> --
> Steve Holden        +1 571 484 6266   +1 800 494 3119
> Holden Web LLC              http://www.holdenweb.com/

I am not convinced it should either stay or go, but it's hard to argue
one way or the other about something so deeply entrenched.  However,
what are your thoughts, whatever the default behavior is, on a
decorator that provides the alternative?  That is, a decorator that
either reevaluates default arguments each time when the language
evaluates them once, or a decorator that evaluates arguments once,
when the languages evaluates them each time?

P.S.
> we would then be receiving posts every week that
> didn't understand the *new* behavior.
That is not obvious and I don't know of any empirical evidence that
entails it.  Hard to search the standard library for that figure.



More information about the Python-list mailing list