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:

    class X:
        @staticmethod
        def example():
            pass
        test1 = example
        test2 = [example,]

    X.example() # OK
    X.test1() # OK
    X.test2[0]() # TypeError: 'staticmethod' object is not callable


Bug or feature?


Thanks!

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

Reply via email to