bpo-29593: Improve UnboundLocalError message.#141
Closed
Carreau wants to merge 1 commit intopython:masterfrom
Closed
bpo-29593: Improve UnboundLocalError message.#141Carreau wants to merge 1 commit intopython:masterfrom
Carreau wants to merge 1 commit intopython:masterfrom
Conversation
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:
def foo():
x = 1
del x
print(x)
foo()
Do the same for free variable.
def multiplier(n):
def multiply(x):
return x * n
del n
return multiply
Member
|
You should create an issue on bugs.python.org for this if it doesn't already exist and mention it here. Comments on pull requests are just for code review of existing issues on b.p.o. |
Contributor
Author
Thanks, done. http://bugs.python.org/issue29593 |
akruis
pushed a commit
to akruis/cpython
that referenced
this pull request
Nov 7, 2017
Call Py_DECREF(frame) with the right recursion_depth.
akruis
pushed a commit
to akruis/cpython
that referenced
this pull request
Mar 25, 2018
Call Py_DECREF(frame) with the right recursion_depth. Add a changelog entry. The actual fix was part of commit cfd51a5.
akruis
pushed a commit
to akruis/cpython
that referenced
this pull request
Jun 19, 2018
Call Py_DECREF(frame) with the right recursion_depth. (cherry picked from commit e520032)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raymond Hettinger reported during PyCon Canada 2016 Keynote (~20m30 sec)
that unbound local error message was inaccurate, it state that :
Though it can be assigned and deleted.
Do the same for free variable.