[issue41392] SyntaxError rather than NameError

2020-07-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

As an example of why it's not possible for the compiler to treat this as a 
syntax error: I use python for my config files. Before I load these files, I 
inject names into the builtins, so that the config files can reference them. 
Some of these are constants, others are callbacks. "false" or anything else 
could be one of the injected names.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41392] SyntaxError rather than NameError

2020-07-25 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The compiler cannot know if "false" is an existing name when compiling. 

One example is that the name might refer to the name of a builtin.

--
nosy: +ronaldoussoren
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41392] SyntaxError rather than NameError

2020-07-25 Thread wyz23x2


Change by wyz23x2 :


--
title: SyntaxError rather than NameError error -> SyntaxError rather than 
NameError

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41392] SyntaxError rather than NameError error

2020-07-25 Thread wyz23x2


wyz23x2  added the comment:

There is nothing *wrong* with the syntax; it's just a regular assignment.
It's not something like `False = 4` or `while = 6` which '=' is invalid.

--
nosy: +wyz23x2
title: Syntax error rather than run time error -> SyntaxError rather than 
NameError error

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com