[Python-Dev] [Python-checkins] cpython: quote the type name for improved readability (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Wed Nov 9 10:44:50 CET 2011
- Previous message: [Python-Dev] [Python-checkins] cpython: quote the type name for improved readability
- Next message: [Python-Dev] [Python-checkins] cpython: quote the type name for improved readability
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 09.11.2011 09:25, schrieb Stefan Behnel:
Stefan Behnel, 07.11.2011 18:46:
Éric Araujo, 07.11.2011 18:24:
http://hg.python.org/cpython/rev/bbc929bc2224
user: Philip Jenvey<pjenvey at underboss.org> summary: quote the type name for improved readability
files: Python/bltinmodule.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1121,7 +1121,7 @@ return NULL; if (!PyIterCheck(it)) { PyErrFormat(PyExcTypeError, - "%.200s object is not an iterator", + "'%.200s' object is not an iterator", it->obtype->tpname); return NULL; } What about displaying the repr of the type object? While I agree that this is more readable, quoted type names are rather rare if not pretty much unprecedented in core exception messages, so this is definitely not the only place that would need changing. However, note that arbitrarily changing exception messages always breaks someone's doctests, so my personal preference would be to keep it as it was. ... and I just noticed that it did break a doctest in Cython's regression test suite. Should I change the test, or will this be taken back?
I recommend reverting the change. I fail to see why quoting the name improves readability.
Regards, Martin
- Previous message: [Python-Dev] [Python-checkins] cpython: quote the type name for improved readability
- Next message: [Python-Dev] [Python-checkins] cpython: quote the type name for improved readability
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]