I noticed inconsistent behavior when using a function callable()with the following code:
>>> x = 4
>>> for i in dir(x):
... if '__' in i:
... continue
... else:
... print i, callable(i)
I get the following results:
bit_length False
conjugate False
denominator False
imag False
numerator False
real False
But when the function is used manually callable():
>>> callable(x.bit_length)
True
What am I missing here?
source
share