[Python-3000] callable()

Guido van Rossum guido at python.org
Thu Jul 27 19:56:06 CEST 2006


On 7/26/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Guido van Rossum wrote:
> > I'd be happy to extend the convention to all such attributes --
> > setting it to None to mean that the subclass doesn't want to provide
> > it. That's clean, can't possibly be interpreted to mean anything else,
> > and doesn't require you to actually call the attribute.
>
> Although unless there's some special casing for it in the
> interpreter, attempting to use such an attribute will
> give a somewhat confusing error message -- something
> like "Object of type NoneType is not callable" instead
> of "Object of type <YourClass> has no __xxx__ attribute".

Yes, of course something like that should be done.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list