[Python-3000] Changing function-related TypeErrors
Guido van Rossum
guido at python.org
Fri May 5 22:55:00 CEST 2006
On 5/5/06, Collin Winter <collinw at gmail.com> wrote:
> On 5/1/06, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > The Type Error is actually referring to the type of 'foo' - the code is
> > clearly expecting it to be something with a different __call__ signature.
> >
> > However, for things like functions, there's nothing wrong with the type of the
> > supplied object. For functions, the problem is actually a Value Error, in that
> > the signature of that particular function *instance* is wrong.
>
> Is there anywhere else in Python where the type of an object isn't
> checkable with isinstance()?
Yes, it's called duck typing.
I'm not sure it's worth distinguishing call signature errors from
other type errors; there's already a gray area where sometimes a
TypeError is reported as an AttributeError or vice versa.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list