compare types?

Erik Max Francis max at
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 /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ All your slick moves / They were once innocent moves
\__/ Sade Quake III Arena /
 A personal guide to Quake III Arena.

More information about the Python-list mailing list