flam...@gmail.com:
> I am wondering if it's possible to get the return value of a method
> *without* calling it using introspection?

Python is dynamically typed, so you can create a function like this:

>>> foo = lambda x: "x" if x else 1
>>> foo(1)
'x'
>>> foo(0)
1

The return type of foo() changes according to the input value.
In general there's not much hope to know the return type if you don't
actually run the function.

Bye,
bearophile
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to