A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039548.html below:

[Python-Dev] Re: closure semantics

[Python-Dev] Re: closure semanticsAlex Martelli aleaxit at yahoo.com
Sun Oct 26 06:01:30 EST 2003
On Saturday 25 October 2003 17:49, Paul Moore wrote:
   ...
> However, one significant issue with your notation scope(outer).x = 23
> is that, although scope(outer) *looks like* a function call, it isn't
> - precisely because scope is a keyword.
>
> I think that, if you're using a keyword, you need something
> syntactically distinct. Now maybe you can make something like

Existing operator keywords, such as, e.g., 'not', get away without
it.  One can use parentheses, write not(x), or not (preferable style);
and what's the problem if "not(x)" CAN indeed look like a function
call while in fact it's not?  I really makes no deep difference here
that 'not' is a keyword and not a built-in function (it does matter
when it's used with other syntax, of course, such as "x is not y"
or "x not in y" or "not x" and so on -- but then, where 'scope' to
be introduced, it, too, like other operator keywords, might admit
of slightly different syntax uses).

Similarly, that 'scope' is a keyword known to the compiler is not
deeply important to the user coding scope(f) -- it might as well
be a built-in, from the user's viewpoint.  It's important to the
compiler, it becomes important if the user erroneously tries to
rebind "scope = 23", but those cases don't give problems.


Alex


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4