python comment juger si une variable est de type booléen

En python, comment juger si une variable est de type bool,python 3.6 utilisation

    for i in range(len(data)):
        for k in data[i].keys():
            if type(data[i][k]) is types.BooleanType:
                data[i][k] = str(data[i][k])
            row.append(data[i][k])
            #row.append(str(data[i][k]).encode('utf-8'))
        writer.writerow(row)
        row = []

mais c'erreurs:

  if type(data[i][k]) is types.BooleanType:

  TypeError: 'str' object is not callable
InformationsquelleAutor bin | 2017-01-12