[Python-3000] callable()

Ronald Oussoren ronaldoussoren at mac.com
Wed Jul 19 19:13:48 CEST 2006


On Jul 19, 2006, at 6:31 PM, Guido van Rossum wrote:

> On 7/18/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> Andrew Koenig wrote:
>>
>>> I am uncomfortable about exposing the implementation this way, if  
>>> only
>>> because it would require fixing the equivalence between callable 
>>> () and
>>> hasattr(obj, '__call__') for all time.
>>
>> I don't see anything bad about fixing that equivalence.
>> I regard the fact that it *wasn't* fixed before as a
>> language design bug that Py3k will hopefully fix.
>
> I seem to recall fixing it. Are there still callable objects without a
> __call__ attribute?

Classic classes?

Python 2.5b2 (r25b2:50570, Jul 11 2006, 09:46:24)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> class O: pass
...
 >>> O.__call__
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: class O has no attribute '__call__'
 >>>

Ronald
>
> -- 
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/ 
> ronaldoussoren%40mac.com



More information about the Python-3000 mailing list