Answer the question
In order to leave comments, you need to log in
Type based branching?
What is the best way to implement similar behavior in python 3.6+?
Pseudocode:
def func(obj)
if isinstance(obj, dict[str, str]):
return 'is dict of strings'
if isinstance(obj, tuple[int]):
return 'is tuple with one integer'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question