Closures in leu of pointers?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Jun 29 15:33:41 EDT 2013


On Sat, 29 Jun 2013 12:20:45 -0700, cts.private.yahoo wrote:

> exactly that.  

Exactly what? Who are you replying to? Your post has no context.


> Without wanting to analyze it in too much depth now, I
> would want a local keyword to allow me to know I was protecting my
> variables, and a way to specify other scopes, without so much implied
> scoping in non-intuitive ways...

Huh? What language are you programming in? Python doesn't have implied 
scoping in non-intuitive ways.

Python does have a way to specify other scopes: global to enable writing 
to the global scope, and in Python 3, nonlocal to specify writing to a 
nonlocal scope.

And what on earth does "protecting my variables" mean? If it means what I 
think it means, Python gives it to you for free: you cannot overwrite a 
variable outside of the local scope without declaring it first. What more 
"protection" do you want?


> Now everybody is gonna tell me how wrong I am, but you asked what I
> want, and that's what keeps aggrevating me with python.

If you want <language X>, you know where to find it.

Perhaps you will find it less aggravating to worry more about the 
concrete problem you want to solve, than the metaproblem of how to 
program Perl using Python syntax.



-- 
Steven



More information about the Python-list mailing list