compare types?

Erik Max Francis max at alcyone.com
Wed Jan 1 05:39:00 CET 2003


Dan Bishop wrote:

> Of course you can't.  type doesn't return a string.

And, through the wonders of Python's interactivity, here's a great way
to tell (for types in general, not just DateTime types):

>>> s = "I'm a string"
>>> type(s)
<type 'str'>
>>> t = type(s)
>>> type(t)
<type 'type'>

"Oh," one should realize at this point, "obviously that's not just some
string, because then its type would have been a string."

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ All your slick moves / They were once innocent moves
\__/ Sade
    Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
 A personal guide to Quake III Arena.




More information about the Python-list mailing list