Pondicherry is an appropriate locale for Pi's upbringing and childhood because it offered a lot of diversity. The book takes place right around 1970s India, and it is a rough place. Not with gangs and that kind of stuff, but government upheaval is happening. Indira Gandhi is flexing her political muscles and establishing more and more stringent rules over Pondicherry and other parts of India. It feels stifling to Pi and his family, because Pondicherry itself is very diverse. Because it was once part of French India, there is a lot of cultural and religious diversity there. It only makes sense that Pi would gravitate toward that diversity. For example, take Pi's religion. He's Christian. And Muslim. And Hindu. At the same time. Pi doesn't see a problem intermixing his three faiths because he sees them intermixing among the population that he lives with.
Pondicherry's diversity mixed with the tightening government oppression serves to show the reader how and why Pi himself is both tolerant and resilient at the same time. Those two skill sets are absolutely critical for his survival on the life boat with Richard Parker.
Pondicherry was the only French colony in India. During the 1930s, when Pi's mother was growing up, the French were trying to make the city as Gallic as the British were trying to make the rest of India Britannic according to Pi (p. 10). Like the city itself Pi is an anomaly. In school he stands out because of his name, Piscine, which he shortens to "Pi" after the other children refer to him as "Pissing." Pi is more cosmopolitan than the people around him, because he knows about many worlds and traditions. He is at first interested in his teacher, Mr. Kumar, who is an atheist. Later he finds Christianity compelling and then becomes interested in Islam. Though he is born Hindu he strives to understand other religions and worlds, and he also strives to understand not only humans but also animals. Pi, like the city of Pondicherry, is unusual, and the cosmopolitan nature of this city makes it an appropriate setting for Pi's upbringing because he grows up knowing about many different traditions and faiths.