Posted By

magicrebirth on 12/22/09


Tagged

object type isinstance


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

silang


Python: checking the type of an object


 / Published in: Python
 

  1. >>> s = "A Simple String"
  2. >>> print isinstance(s, basestring)
  3. True
  4. >>> print isinstance(s, dict)
  5. False
  6. >>>

Report this snippet  

You need to login to post a comment.