0

I have a variable definite with a "def", it's a function :

o = [<function result at 0x7f222138c7d0>]
type(o) = <type 'function'>

How to integer a if in my code ?

if type(o) == 'function':  # pseudocode
   print 'Found!'

Thanks

4
  • Your question is a little hard to decipher - it appears you want to ask how to check if a variable is a function? (Rather than 'defining' one). Commented Jan 12, 2015 at 15:59
  • Yes, it's the good title for my question. I will edit it. Commented Jan 12, 2015 at 16:00
  • callable(o) works fine. Thanks all Commented Jan 12, 2015 at 16:02
  • I have a similar question here: Commented Jan 12, 2015 at 16:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.