Static variables [was Re: syntax difference]

Bart bc at freeuk.com
Sun Jun 24 06:23:12 EDT 2018


On 24/06/2018 01:53, Ben Bacarisse wrote:
> Bart <bc at freeuk.com> writes:

>> Wow. (Just think of all the times you write a function containing a
>> neat bunch of local functions, every time it's called it has to create
>> a new function instances for each of those functions, even if they are
>> not used.)
> 
> I am surprised that this surprises you, and equally surprised that you
> seem to think it's going to be in some way grossly inefficient.

Steven D'Aprano's reply suggests there /is/ some inefficiency which is 
why [according to him] nested functions are rarely used that way.

-- 
bartc





More information about the Python-list mailing list