
On Sat, 10 Aug 2019 at 02:05, Eric V. Smith <eric@trueblade.com> wrote:
On 8/9/2019 11:41 AM, Tim Peters wrote:
[Guido]
I don't see how this debate can avoid a vote in the Steering Council.
FWIW, I found Nick's last post wholly persuasive: back off to SyntaxError for now, and think about adding a more specific exception later for _all_ cases (not just walrus) in which a scope conflict isn't allowed (e.g., his example of declaring a function's formal argument `global` in the function).
Also FWIW: I agree with Nick, except I don't see the point of having an exception that likely no one is ever going to catch. What's the scenario under which you'd want to catch a ScopeConflictException? If it only exists to give more info to a human, just improve the message that goes with SyntaxError in that case.
It's mainly the idea of being able to attach the variable name to the exception as structured data, which an IDE could then use to highlight the offending name without needing to parse the human-readable exception string. Actually making the change would require IDE authors agreeing that it would be helpful to them, though, and they may not need it if they already have their own symbol analysers running. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia