checking one's type

belinda thom bthom at
Fri Jan 5 03:40:44 EST 2007


I've been using the following hack to determine if a type is  
acceptable and I suspect there is a better way to do it:


if type(s) == type("") :
    print "okay, i'm happy you're a string"

If anyone knows a better way, I'm all ears.



More information about the Python-list mailing list