[issue37645] Replace PyEval_GetFuncName/PyEval_GetFuncDesc

Petr Viktorin report at bugs.python.org
Thu Aug 15 11:02:26 EDT 2019


Petr Viktorin <encukou at gmail.com> added the comment:

I am not convinced.

I'm wary of making error messages depend on the str representation of a function; that would prevent us from changing it later.
I'm wary of "%S" used in error messages. Those are for the programmer, not the user, so they should prefer __repr__.

I train beginners to recognize "<function f at 0x7f9f4bbe5e18>" as a sign of omitted parentheses. The ugliness is useful: it shows you're dealing with an internal object, not a data value.

So, I think "<function f>" is much better than just "f()". I wouldn't mind "<function f()>" (maybe even with the full signature), but that doesn't quite help this case.
(I don't care much for the "at 0x7f9f4bbe5e18" part, but that's not the issue here.)

----------
nosy: +petr.viktorin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37645>
_______________________________________


More information about the Python-bugs-list mailing list