[Python-Dev] Re: Metatype conflict among bases?
Alex Martelli
aleax@aleax.it
Wed, 23 Apr 2003 15:49:54 +0200
On Wednesday 23 April 2003 02:17 pm, David Abrahams wrote:
...
> it, so I don't mind getting a bit more essay-like. Just today on
> python-list I saw this
>
> >>> range(map(lambda x:x+1, [0, 100, 3]))
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> TypeError: an integer is required
>
> come up as a problem for someone.
It's a bit better in the current CVS Python -- essentially all error
messages from built-ins now identify which built-in is involved, and
many give extra, pertinent information -- e.g.:
[alex@lancelot src]$ ./python -c 'range(map(str,[1,2,3]))'
Traceback (most recent call last):
File "<string>", line 1, in ?
TypeError: range() integer end argument expected, got list.
As long as the message still typically fits within one line, I think there can
be no substantial objection to making it clearer and more infomative.
Alex