Callable assertion?
Greg Ewing (using news.cis.dfn.de)
g2h5dqi002 at sneakemail.com
Wed Oct 8 02:05:13 EDT 2003
Erik Max Francis wrote:
> "Gonçalo Rodrigues" wrote:
>
>>Definitely yes. There are a few strange objects that are callable and
>>do not have a __call__.
>
> I wouldn't call class objects all that strange :-).
It is strange behaviour, though, considering
>>> class C:
... pass
...
>>> type(C).__dict__.keys()
['__delattr__', '__setattr__', '__repr__', '__call__', '__str__',
'__getattribute__', '__new__']
so according to C's type, it *should* have a __call__ method.
I'm not sure exactly what's going on here.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list