mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Reduce the usage of the types module.
This commit is contained in:
parent
a164574937
commit
f715366f23
8 changed files with 64 additions and 68 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue