[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: Exactly -- resolution: -> duplicate status: open -> closed superseder: -> function with modified __name__ uses original name when there's an arg error ___ Python tracker

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Mark Dickinson
Mark Dickinson added the comment: http://bugs.python.org/issue4322 ? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: That's because argument error messages use the code's co_name rather than the functions. (This is a dupe of another bug about this that I can't find.) -- nosy: +benjamin.peterson ___ Python tracker

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry. The actual problem reported was that the traceback uses the wrong name. I can still reproduce this in 3.4; attached is a repro. -- Added file: http://bugs.python.org/file31160/functools_wraps_oddity.py ___ P

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Madison May
Madison May added the comment: Yup, here are the relevant lines of the diff for PEP 3155: @@ -568,7 +607,7 @@ func_repr(PyFunctionObject *op) { return PyUnicode_FromFormat("", - op->func_name, op); + op->func_qualname, op); } -

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread STINNER Victor
STINNER Victor added the comment: Python 3.4.0a0 (default:62658d9d8926+, Aug 1 2013, 23:05:18) [GCC 4.4.1 20090725 (Red Hat 4.4.1-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> def func(): pass ... >>> func >>> func.__qualname__="PEP 3155" >>> func

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Mark Dickinson
Mark Dickinson added the comment: I guess this is a direct consequence of PEP 3155 [1]. From the PEP: """ The repr() and str() of functions and classes is modified to use __qualname__ rather than __name__. """ [1] http://www.python.org/dev/peps/pep-3155/ -- nosy: +mark.dickinson, pit

[issue18656] setting function.__name__ doesn't affect repr()

2013-08-04 Thread Guido van Rossum
New submission from Guido van Rossum: In Python 3.2 and earlier: >>> def f(): pass ... >>> f.__name__ = 'g' >>> f However in Python 3.3 and later, the last line shows 'f' instead of 'g'. -- components: Interpreter Core messages: 194394 nosy: gvanrossum priority: normal severity: norma