On Wed May 16 20:53:46 EDT 2018, Steven D'Aprano wrote:
> On Wed, May 16, 2018 at 07:24:19PM +0200, Adam Bartoš wrote:
>> Hello,
>>
>> I have yet another idea regarding the the clashes between new keywords
and
>> already used names. How about introducing two new keywords *wink* that
>> would serve
On Wed, May 16, 2018 at 07:24:19PM +0200, Adam Bartoš wrote:
> Hello,
>
> I have yet another idea regarding the the clashes between new keywords and
> already used names. How about introducing two new keywords *wink* that
> would serve as lexical keyword/nonkeyword declarations, similarly to
>
My proposal assumes we want to be able to reference the name as defined in
external libraries, but never have it be a name and a keyword in the same
namespace. Your proposal (and the others I've seen) seem to be deliberately
aiming to allow that.
Do you want to have keywords that are names in the
If `def(if=3)...` works implicitly, then why not make `if = 3`, `x.if
= 3`, `import
if`, `def if` and `class if` implicit too?
Another issue is what happens here:
keyword if
import if
f(if=3)
f.if = 3
The keyword will be a valid name in old code, so you need to be able to
reference it as a name
On 5/16/2018 1:24 PM, Adam Bartoš wrote:
Hello,
I have yet another idea regarding the the clashes between new keywords
and already used names. How about introducing two new keywords *wink*
that would serve as lexical keyword/nonkeyword declarations, similarly
to nonlocal and global
Hello,
I have yet another idea regarding the the clashes between new keywords and
already used names. How about introducing two new keywords *wink* that
would serve as lexical keyword/nonkeyword declarations, similarly to
nonlocal and global declarations?
def f():
nonkeyword if
if = 2 #