On 5/8/06, Steven Bethard <[EMAIL PROTECTED]> wrote:
> It'd certainly be nice to be able to tell the difference between
> the following two TypeErrors:
>
> >>> def s():
> ... raise TypeError()
> ...
> >>> 's'()
> Traceback (most recent call last):
> File "<interactive input>", line 1, in ?
> TypeError: 'str' object is not callable
> >>> s()
> Traceback (most recent call last):
> File "<interactive input>", line 1, in ?
> File "<interactive input>", line 2, in s
> TypeError
You're kidding yourself. Consider these two:
def s():
raise NotCallable("ha ha, fooled you!")
or more likely any variant of this:
def s():
's'()
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com