Suppose I have a python function def func_AB(param1: str). param1 can only take on values A or B. If it takes on any other string value, an error should appear.
Is it possible to use python type checking to give out error when this happens? Currently, I use assert to check that param1 contains the valid string value.
I am using python 3.8.5