RE:
I can't remember ever taking advantage of the fact that mutable default arguments are shared accross function invocations.
Can you remember taking advantage of the fact Python is logical, consistent, and elegant? I tend to think its lack of syntactic sugar and exceptions set it apart. Although there are sometimes things that could bite you, there's a lot of value in having those things be perfectly predictable, like having default argument values evaluated once, when the function declaration is evaluated. To do it any other way would introduce an unnecessary "except when" into the explanation of Python.
Shane Green
www.umbrellacode.com
805-452-9666 | shane@umbrellacode.com
On Jan 2, 2013, at 3:08 AM, alex23
On Jan 2, 5:29 pm, Antoine Pitrou
wrote: Let's call them a compromise then, but calling them a language feature sounds delusional. I can't remember ever taking advantage of the fact that mutable default arguments are shared accross function invocations.
I'd say it's slightly more delusional to believe that if _you_ haven't used a language feature, that it's not a "feature". _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas