Hasten istype

This commit is contained in:
Gouvernathor 2023-11-11 20:42:56 +01:00 committed by LoafyLemon
parent b550040369
commit 36d79b4bb2

View File

@ -186,9 +186,9 @@ init python early:
return s1.replace(filter, "") == s2.replace(filter, "") return s1.replace(filter, "") == s2.replace(filter, "")
def istype(inst, clss): def istype(inst, clss):
if not isinstance(clss, (list, tuple, set)): if isinstance(clss, (list, tuple, set)):
clss = (clss,)
return type(inst) in clss return type(inst) in clss
return type(inst) is clss
class IntLike(python_object): class IntLike(python_object):
# Does not support rollback # Does not support rollback