Mar-07-2022, 07:27 AM
You haven't shown any code, but it sounds like your function is quite complex if it has to handle all these different cases. Perhaps polymorphism, whether with classes, or e.g. functools.singledispatch would be a better design?