[issue29593] Improve UnboundLocalError message for deleted names

2017-08-17 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Thanks you all for your input, it seem like to much of electronic ink and time has been spend on this issue. For the sake of everyone and avoiding more to be spent, I'm going to close it. -- resolution: -> duplicate stage: -> resolved status:

[issue29593] Improve UnboundLocalError message for deleted names

2017-08-16 Thread Vedran Čačić
Vedran Čačić added the comment: Re: http://bugs.python.org/msg288032 I don't know what example Raymond had, but your example In [5]: def foo(): ...: n = 1 ...: def g(): # imagine a more complex g ...: del n ...: g() ...: print(n) #UnboundLocalError is

[issue29593] Improve UnboundLocalError message for deleted names

2017-08-16 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue29593] Improve UnboundLocalError message for deleted names

2017-03-21 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue29593] Improve UnboundLocalError message for deleted names

2017-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue17792. -- ___ Python tracker ___ ___ Python-bugs-list

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Martin Panter
Martin Panter added the comment: Matthias’s proposal sounds reasonable to me. There is a minor disadvantage that it will exceed the width of an 80-character terminal: UnboundLocalError: local variable 'x' referenced before assignment, or got delet ed But I don’t think the wrapping is a big

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: > makes the error message longer Out of curiosity is there a guide as to what is considered a too long error message ? Or is there a technical reason like after a certain length strings are not cached and exception will be slower to construct ? I'm

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Adding "or got deleted" makes the error message longer, and since "del" is rarely used for deleting local variables I afraid that it can add confusion in most cases. The "del" statement is not the only way to unset the local variable. >>> def foo(): ...

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: > Wouldn't be better to say just "local variable 'xxx' is not set"? Thank you for responding that fast and for your interest in this issue. While I think that "local variable 'xxx' is not set" is technically correct, I think it would be a step back.

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Wouldn't be better to say just "local variable 'xxx' is not set"? -- components: +Interpreter Core nosy: +martin.panter, r.david.murray, rhettinger, serhiy.storchaka ___ Python tracker

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Matthias Bussonnier
New submission from Matthias Bussonnier: Raymond Hettinger reported during PyCon Canada 2016 Keynote (~20m30 sec) that unbound local error message was inaccurate, it state that : > local variable 'xxx' referenced before assignment Though it can be assigned and deleted. for a toy example: