Consider the following function:
def foo(a, b, c):
""" Toy function
"""
return a, b, c
Each of these arguments will be of type numpy.array
. I need to efficiently determine which of these arguments has more than one element for use further in the function. I'd like to avoid testing each argument with an if
statement as the list can be large and performance is important. Assume that only one argument will have more than one element.
How can I determine which of the input arguments has more than one element?