How I can get the number of elements returned from a function whithout execute it ? And may be also, know the type of these elements ?
I know i can do something like :
def foo ():
return 'a', 2
handle = foo()
print len(handle)
>> 2
But here i need to execute my function …
You can’t — A function can return different numbers of arguments (stored in a single tuple) and different types of variables in that tuple depending on input or other factors. consider the (silly) function:
Now call it:
The only way to know what a function will return is to 1) read the source or 2) (If you’re a trusting sort of person) read the documentation for the function :-).