On Thu, 11 Jul 2013 15:05:59 +0200, Ulrich Eckhardt wrote:

> Hello!
> 
> I just stumbled over a case where Python (2.7 and 3.3 on MS Windows)
> fail to detect that an object is a function, using the callable()
> builtin function. Investigating, I found out that the object was indeed
> not callable, but in a way that was very unexpected to me:
[...]
>      X.test2[0]() # TypeError: 'staticmethod' object is not callable
> 
> 
> Bug or feature?

In my opinion, a bug. I thought I had actually submitted it to the bug 
tracker, but apparently I was a shameful slacker and did not. However 
there was a discussion in this thread:

http://mail.python.org/pipermail/python-dev/2011-March/109090.html


Here's a simpler demonstration of the issue:

assert callable(staticmethod(lambda: None))


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to