【发布时间】:2014-07-07 10:41:41
【问题描述】:
我有一个函数调用另一个函数并继续调用函数的结果。
我要做的是检查被调用的函数是否返回response 对象,然后在现有函数中使用它。
我尝试使用 isinstance,但没有得到要使用的 arg。
def func(request):
return HttpResponse('xyz')
def check_func(request):
res = func()
# Here I want to check if res is response object or not
# And continue accordingly
建议一些检查方法。
【问题讨论】: