Static variables [was Re: syntax difference]

Bart bart at 1
Sun Jun 24 12:23:12 EDT 2018


  To: Ben Bacarisse
From: "Bart" <bart at 1:261/38.remove-ij1-this>

  To: Ben Bacarisse
From: Bart <bc at freeuk.com>

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

-+- BBBS/Li6 v4.10 Toy-3
 + Origin: Prism bbs (1:261/38)

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)



More information about the Python-list mailing list