On 2018-04-29 04:17 PM, Nikolaus Rath wrote:
On Apr 27 2018, Tim Peters <tim.peters-re5jqeeqqe8avxtiumw...@public.gmane.org> 
wrote:
Then `c` is 12, but `a` is still 1 and `b` is still 2.  Same thing in the end:

c = local(a=3, b=4, a*b)
I think this can be done already with slighly different syntax:

c = (lambda a=3, b=4: a*b)()


The trailing () is a little ugly, but the semantics are much more
obvious. So maybe go with a variation that makes function evaluation
implicit?

c = lambda! a=3, b=4: a*b

(reads terrible, but maybe someone has a better idea).


if local(m = re.match(regexp, line)):
     print(m.group(0))
Of course, that wouldn't (and shouldn't) work anymore. But that's a good
thing, IMO :-).


Best,
-Nikolaus


Has anyone heard of Lua? Lexical scoping? Block scope? (Python doesn't have blocks and that sucks?) Etc?
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to