Posted By

silviud on 07/11/10


Tagged

python module types


Versions (?)

pyton types


 / Published in: Python
 

URL: http://effbot.org/librarybook/types.htm

  1. import types
  2.  
  3. def check(object):
  4. print object,
  5. if type(object) is types.IntType:
  6. print "INTEGER",
  7. if type(object) is types.FloatType:
  8. print "FLOAT",
  9. if type(object) is types.StringType:
  10. print "STRING",
  11. if type(object) is types.ClassType:
  12. print "CLASS",
  13. if type(object) is types.InstanceType:
  14. print "INSTANCE",
  15. print

Report this snippet  

You need to login to post a comment.