Preferred way of determining type

Emile van Sebille emile at fenx.com
Wed May 16 13:49:41 EDT 2001


More frequently lately it seems that isinstance(obj, types.Type) or simply
if type(obj) == types.Type is recommended over what I regularly use, eg:  if
type(obj) == type([]).

Anyone care to explain why or in what circumstances there's a difference?

--

Emile van Sebille
emile at fenx.com

---------





More information about the Python-list mailing list