Roundup Robot added the comment:
New changeset f1d3fbcd837d by Ezio Melotti in branch 'default':
#17032: The global in the NameError: global name 'x' is not defined error
message has been removed. Patch by Ram Rachum.
http://hg.python.org/cpython/rev/f1d3fbcd837d
--
nosy: +python-dev
Ezio Melotti added the comment:
Fixed, thanks for the patch!
--
assignee: - ezio.melotti
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
Ram Rachum added the comment:
Awesome, thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Python-bugs-list mailing list
Ezio Melotti added the comment:
Not yet, I wanted to make sure that everyone agrees on the change.
If I don't get other replies I'll commit it soon.
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
Ram Rachum added the comment:
(I fixed the patch to not have a typo.)
--
Added file:
http://bugs.python.org/file29290/cpython_patch1of1_8e9346e7ae87.patch.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
Changes by Ram Rachum r...@rachum.com:
Removed file:
http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
Changes by Terry J. Reedy tjre...@udel.edu:
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Terry J. Reedy added the comment:
I just opened #17339 about another situation where the error message references
only the last of several checks that failed.
bytes(object()) # raises
TypeError: 'object' object is not iterable # or 4 other possibilities
I think any message like this should
Ezio Melotti added the comment:
GLOBAL_NAME_ERROR_MSG has been introduced in fd8c7203251f as part of PEP 227 by
Jeremy Hylton, so I'm adding him to the nosy to see if he agrees with the
change (also adding a couple more devs to see if they have any comments).
There's also a typo in the last
Changes by Philip Jenvey pjen...@underboss.org:
--
nosy: +pjenvey
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Python-bugs-list
Terry J. Reedy added the comment:
+NAME_ERROR_MSGy, name);
will give a NameError ;-).
The patch undoes the change from 'name' to 'global name'. Skimming the PEP, I
do not see this change mandated or justified by the PEP. So my current view:
while it is true that it is the final, global
Ram Rachum added the comment:
I made a patch. Is it okay? (I don't normally use Mercurial nor work with
patches.)
--
keywords: +patch
Added file:
http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch
___
Python tracker
Éric Araujo added the comment:
Patch looks good. Does the test suite still pass?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Ram Rachum added the comment:
I don't program C at all. I have no idea how to compile Python or run the test
suite. It took me half an hour just to produce this patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
Éric Araujo added the comment:
If you’re using a programmer-friendly OS compiling is not hard. See
http://docs.python.org/devguide for instructions. Otherwise somebody else will
test the patch. Thanks for your contribution!
--
___
Python tracker
Ram Rachum added the comment:
I think I'll go for option 2, thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Ram Rachum added the comment:
Does fixing this ticket require anything more than making a change in the
string that Python uses for this exception?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
New submission from Ram Rachum:
Every single time I see the error message `global name 'X' is not defined` I
say to myself, ah yeah, I mistyped a variable name.
But then it occurred to me, why should I have to do this mental translation
from global name not defined to I mistyped a variable
Ezio Melotti added the comment:
Maybe we could just drop the 'global'.
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
Ramchandra Apte added the comment:
+1 on Ezio's idea.
--
nosy: +ramchandra.apte
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Éric Araujo added the comment:
Dropping global sounds good. (Let’s not replace name with variable though!)
--
nosy: +eric.araujo
versions: -Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
21 matches
Mail list logo