Why no string return?
adonis_vargas at -Remove-This-bellsouth.net
Wed Mar 12 05:45:32 CET 2008
> Say i have the two methods:
> def ReturnMethod(request, x):
> if request is True:
> return x
> else: print "No String for you...False!"
> def SendMethod(request):
> xstring = "Some text"
> ReturnMethod(request, xstring)
> Why does ReturnMethod not return the string x? I do believe it is
> returning with a NoneType.
> Any help would be greatly obliged
> Thanks, Josh
That is because request is bound a string (str) object. You are probably
testing for null so it should look like:
print "No String for you...False!"
Hope this helps.
More information about the Python-list