[Python-Dev] PEP-343 - Context Managment variant
jcarlson at uci.edu
Tue Aug 9 01:46:52 CEST 2005
falcon <falcon at intercable.ru> wrote:
> It's idea was token from Ruby. But I think, good idea is good whatever it came from.
> It can be not Pythonic.
Just because something may be a good idea, doesn't mean that the idea is
Pythonic. The only person who can truely say is Guido, but you can gain
some insight by reading the zens (from the console, 'import this').
The fact is, context management has a syntax that has been accepted.
Your first example:
> def Synhronised(lock,func):
> def Some():
> def Work():
> global local_var3
> return asd(local_var3)
... becomes ...
local_var3 = Here_I_work(local_var1,local_var2,local_var3)
Which is quite close to what you offer:
It is of my opinion that your proposal is destined to fail for at least
two reasons; 1) context management already has an accepted syntax 2)
ruby blocks were found (due to lack of evidence to the contrary) to gain
Python users very little (if anything) over the accepted context
To note; unless your post is of the utmost importance, cross-posting to
python-list and python-dev seems quite rude to me. Further, a variant
of Ruby block syntax was offered way back in February and March (read
the python-dev archives available at
http://mail.python.org/pipermail/python-dev/ ). Reading what was
already discussed may offer you insight into what (if any) open issues
were remaining, and precisely why the context management syntax was
supported over anonymous blocks/thunks/Ruby blocks.
More information about the Python-list