<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">Hi all,</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">Yes, this is another idea for avoiding breaking existing code when introducing new keywords. I'm not sure if this is too similar to Guido's previous "allow keywords in certain places" idea, but here goes:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">Only treat keywords as having any special meaning when they are in places with syntactical significance.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">So, currently, let's say someone set the variable "and_" to some value. The following lines are both SyntaxErrors:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    True and_ False</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    obj.and = value</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">And the following are both correct:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    True and False</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    obj.and_ = value</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">My idea is to only treat keywords as having special meaning when they're in the right place. So the following would all be legal:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> from operator import and</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> var = and(True, False)</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> var</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    False</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> var = True and False</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> var</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    False</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> def except(exc, def):</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...     try:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...         return def()</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...     except exc as e:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...         return e</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> except(ZeroDivisionError, lambda: 1/0)</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ZeroDivisionError('division by zero',)</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> except(ZeroDivisionError, lambda: 0/1)</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    0.0</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> import asyncio as await #this is already currently legal, but will not be in the __future__</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>> async def async(def):</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...     return await await.get_event_loop().run_in_executor(None, def)</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    ...</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">    >>></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">And so on.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff">What are your thoughts?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#0000ff"><br></div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font face="monospace, monospace"><span style="color:rgb(0,0,255)"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(0,0,255);display:inline">​Sharing,</div></span><br></font></div><font color="#0000ff" face="monospace, monospace"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(0,0,255);display:inline">​Ken Hilton</div>;</font><br></div></div></div></div></div></div></div></div></div>
</div>