[Python-ideas] easy thread-safety [was: fork]
Ron Adam
ron3200 at gmail.com
Fri Aug 21 06:21:25 CEST 2015
On 08/20/2015 10:57 PM, Steven D'Aprano wrote:
> On Thu, Aug 20, 2015 at 04:02:52PM -0400, Ron Adam wrote:
>
>> >The semantics is to have a way to make names (for mutable objects) in
>> >outer scopes not be visible to function defined in inner scopes.
> Why would you want that? This is a serious question -- there is already
> an easy way to ensure that two functions can't see the other's
> variables:*don't* nest them. The reason for nesting them is to ensure
> that the inner function*can* see the outer's variables. That's the
> whole point of nesting.
Ok, I'm convinced it's wouldn't do what I initially was thinking. It
could possibly offer some benefits to catch some programming errors, but
not enough, and would not help with threads.
Hmmm... I think maybe I mixed up some dynamic scope behaviour with
static scope in my initial thoughts. That would be quite different, but
not python. (No, don't explain further, it was a mistake on my part, as
I know the difference.)
Oh, and thanks to you and Andrew for the feedback, even though it didn't
go anywhere.
Cheers,
Ron
More information about the Python-ideas
mailing list