checking one's type

Fredrik Lundh fredrik at pythonware.com
Fri Jan 5 04:57:12 EST 2007


belinda thom wrote:

> 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:
> 
> e.g.
> 
> if type(s) == type("") :
>     print "okay, i'm happy you're a string"
> 
> If anyone knows a better way, I'm all ears.

     http://preview.tinyurl.com/yjnoc5

</F>




More information about the Python-list mailing list