Posts: 4,665
Threads: 1,502
Joined: Sep 2016
isinstance() arg2 is limited to a type or a tuple of types. it won't even accept a list of types.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,665
Threads: 1,502
Joined: Sep 2016
what do you mean by "not a range of types"?
1. you use something else for a range of type.
2, you never do a range of types.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,665
Threads: 1,502
Joined: Sep 2016
i coded this:
def istype(a,b):
x=type(a)
return x is b or x in bin
this function, arg2 can be any container type supported by the RHS of
in.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.