Reduce the usage of the types module.

This commit is contained in:
Raymond Hettinger 2005-02-07 14:16:21 +00:00
parent a164574937
commit f715366f23
8 changed files with 64 additions and 68 deletions

View file

@ -71,7 +71,7 @@ if sys.version_info[:2] < (2, 2):
False, True = 0, 1
def isinstance(obj, clsinfo):
import __builtin__
if type(clsinfo) in (types.TupleType, types.ListType):
if type(clsinfo) in (tuple, list):
for cls in clsinfo:
if cls is type: cls = types.ClassType
if __builtin__.isinstance(obj, cls):