On Mon, 11 Feb 2008 10:41:44 -0500, Steve Holden wrote:

> If the "type" variable really is a type, of course, then the real
> solution is hardly radical: stop using the names of types and start
> using the types:

[snip example using "type(obj) in (type1, type2)"]


But if you're using actual types, you almost certainly want to allow for 
subclasses as well:

isinstance(obj, tuple_of_types)


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to