我有一个功能,
def _get_package_(sandboxId):
for i in response_tci_sandboxes['Items']:
if sandboxId == i['id']['S']:
if i.get('sandboxType') == 'operational':
return True ## Please note that true(lowercase) is not allowed
else:
return False
return 1
现在的问题是,当我将上述函数返回的值传递给put_item函数时,抛出了错误,因为它期望布尔值是小写的,即true或false。
我试图用这种东西。
str(_get_package_(sandboxId)).lower
但是put_item将其作为字符串放入,由于数据类型为BOOL,因此请求被拒绝。