python equivalent of wantarray() : newbie

Karthik Gurumurthy karthikg at aztec.soft.net
Wed Sep 12 05:29:41 EDT 2001


please bear with me, am still learning.

is there a way to determine whether a return value is expected from a
method?
like the way wantarray() works in perl.

perl can determine the type of the variable used

@array = call()//so it's list context so call can return a list
$var = call()//scalar context so call can return say a string.

But can python determine the same?? i guess it can't and that's why we don't
have a wantarray() equivalent
in python??

thanks,
karthik.




More information about the Python-list mailing list