[Python-ideas] Documenting Python warts
Shane Green
shane at umbrellacode.com
Wed Jan 2 12:52:27 CET 2013
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 at umbrellacode.com
On Jan 2, 2013, at 3:08 AM, alex23 <wuwei23 at gmail.com> wrote:
> On Jan 2, 5:29 pm, Antoine Pitrou <solip... at pitrou.net> 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 at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130102/ea66a9c5/attachment.html>
More information about the Python-ideas
mailing list