Late-binding of function defaults (was Re: What is a function parameter =[] for?)

MRAB python at mrabarnett.plus.com
Thu Nov 26 11:16:57 EST 2015


On 2015-11-26 12:53, BartC wrote:
> On 26/11/2015 01:52, Ned Batchelder wrote:
>> On Wednesday, November 25, 2015 at 8:23:36 PM UTC-5, BartC wrote:
>>> On 26/11/2015 00:31, Steven D'Aprano wrote:
>
>>>> It really, truly isn't. Your viewpoint is clouded by too much immersion in
>>>> crippled languages. *Old and obsolete versions* of crippled languages.
>>>> Dynamic creation of functions goes back to the 1950s.
>
>>> It's funny then that the vast majority of top-level function definitions
>>> I see in Python (and import and class statements too) are decidedly static.
>
>> I almost started to explain about how yes, Python is often written in
>> conservative static ways. I was going to mention that a little dynamic
>> nature goes a long way, and is never far from the surface in even the
>> simplest Python programs.
>>
>> But I won't, because I'm not sure you're really interested.  There's a
>> pattern here of people trying to explain Python to you, and eventually,
>> after many words, getting to some kind of shared understanding, only
>> for you to shrug it all off as a fad, or pocket-lining, or needless
>> complexity.
>
> I'm sorry if I've been misunderstood.
>
> I simply stated that Python's approach was novel. Steven D'Aprano then
> responded by belittling my view, and effectively trashing every language
> I've ever used.
>
[snip]
Well, it's not /that/ new.

Both Forth and PostScript define functions by execution.




More information about the Python-list mailing list