Was Mahatma Gandhi a racist?

https://www.bbc.co.uk/news/world-asia-india-34265882

In The South African Gandhi: Stretcher-Bearer of Empire, Desai and Vahed write that during his stay in Africa, Gandhi kept the Indian struggle "separate from that of Africans and coloureds even though the latter were also denied political rights on the basis of colour and could also lay claim to being British subjects".

They write that Gandhi's political strategies - fighting to repeal unjust laws or freedom of movement or trade - carved out an exclusivist Indian identity "that relied on him taking up 'Indian' issues in ways that cut Indians off from Africans, while his attitudes paralleled those of whites in the early years". Gandhi, the authors write, was indifferent to the plight of the indentured, and believed that state power should remain in white hands, and called black Africans Kaffirs, a derogatory term, for a larger part of his stay in the country.

In 1893, Gandhi wrote to the Natal parliament saying that a "general belief seems to prevail in the Colony that the Indians are better than savages or the Natives of Africa".

In 1904, he wrote to a health officer in Johannesburg that the council "must withdraw Kaffirs" from an unsanitary slum called the "Coolie Location" where a large number of Africans lived alongside Indians. "About the mixing of the Kaffirs with the Indians, I must confess I feel most strongly."