Joe Amenta <ament...@msu.edu> added the comment:

One such weird corner case:

from collections import Callable
class Spam(object):
   def __call__(self):
      return self

can_of_spam = Spam()
print callable(can_of_spam) == isinstance(can_of_spam, Callable) # True
del Spam.__call__
can_of_spam.__call__ = lambda can: 'spam'
print callable(can_of_spam) == isinstance(can_of_spam, Callable) # False

Regardless, attached a patch for the new proposed semantics

----------
keywords: +patch
nosy: +joe.amenta
Added file: http://bugs.python.org/file15671/new_callable_semantics.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to