A long time ago, on a train rumbling through rural France, a local asked me where I was from. I told him. His face lit up. “Chicago!” he exclaimed. “Bang bang, eh!”

“That’s right,” I said. “Bang bang.”

I suppose I could have taken offense at a stranger’s depiction of my hometown as the world capital of gangster violence, but instead I felt a certain amount of pride. If I had told him I was from Kansas City or Columbus, he would have drawn a blank. Chicago had an identity, even if it was, by most standards, a dubious one.

And it’s an identity the city itself has been happy to exploit. If you come to Chicago, you can visit a gangster museum, stop by a garage where Mafiosos used to hang out, or take a guided tour of crime spots all over the city. At one time, there was a museum devoted entirely to Al Capone’s life and misdeeds. Whatever you may think of Chicago’s history of hoodlum violence, the town isn’t apologizing for it.

But this isn’t a column about Chicago’s gang wars of the last century, or about the current wave of gang homicides that continues to give the city a violent reputation. It’s about the deep-seated desire of nearly every city to have some sort of reputation -- to convince itself and the world that it is more than just an ordinary place.

Traveling to many American cities over the years, I’ve been struck by how far their leading citizens will go to point out something distinctive in the local culture or politics. Often they’ll do this even in the face of ample evidence that the qualities they like to tout aren’t so unique after all.

I couldn’t begin to count the number of times I’ve been told that the place I’m visiting is a “city of neighborhoods,” and that this is the secret to understanding what makes it different from other cities. Neighborhood values are a point of pride to local enthusiasts almost everywhere. But the very universality of the observation is proof that these values don’t make a place unusual. As you get to know any community, finely grained differences begin to pop out, and you realize, for example, that Williamsburg and Greenpoint are distinct Brooklyn neighborhoods with different cultures and histories. But the same can be said about any adjoining neighborhoods in any large American city. It’s just a principle of urban life. It doesn’t stand as a claim to fame.

Politicians in every city will tell you that there’s a key to mastering the code of its local political culture. The key is that its voters are fiercely independent, determined to assess candidates as individuals and unwilling to support any of them merely on the basis of party. It’s a gratifying self-image to have, and it’s always possible to point to election returns that seem to reflect it. But you can find the same examples just about anywhere. If you look at the last century of politics in America’s large cities, you’ll usually find a rather consistent history of long-term partisan loyalties, broken every once in a while by a charismatic outsider whose appeal cuts across party lines. Then it’s back to normal again.

It’s true that partisan allegiances have grown weaker over the past generation in many cities, just as they have at other levels of American government. But it’s hard to argue that a streak of independence is uniquely or overwhelmingly characteristic of any particular place. Still, this is an identity that quite a few cities and public officials find comforting.

The reality is that during the past generation, in certain rather conspicuous ways, most American cities have lost many of the qualities that once separated them from one another. The locally owned businesses that used to set the tone for a city’s life have largely disappeared. Family-run department stores have given way to national chains. Fast food has taken a toll on local cuisine. And on and on. In this respect, it is harder for most cities to make a case for their distinctiveness than it was 50 years ago.

There are, of course, outliers. New Orleans and San Francisco are and will remain quirky and different. Spend five minutes in the center of either one and you know where you are. The more time you spend looking into their values and customs, the more special they seem. But the uniqueness of New Orleans and San Francisco serves merely to highlight the increasing standardization of medium-sized to large cities almost everywhere else in the country.

And yet the more cities come to look alike, the more important it is for many of them to find ways to stand out. Take, for example, the case of Indianapolis. For decades it was viewed by visitors and residents alike as the epitome of bland Midwestern sameness -- “Indianoplace,” or “Naptown,” as many of them insisted on calling it. But in the past couple of decades, it has found a partial identity as a sports center, headquarters of the NCAA and host to a seemingly endless array of amateur and professional athletic events every year. Sports hasn’t made Indianapolis unique, but it has given it at least a semblance of an identity, and is one reason why the city has done rather well in recent years.

Then there is Pittsburgh. Hardly any city has had a clearer identity, and then lost the underpinnings of that identity in such a short time. Pittsburgh was, for most of its history, Steel City. It was a city where the professional football team was named after a collection of factories. In the years after 1970, virtually all the steel plants closed. That might have been enough to make the whole area a sad relic of the Industrial Age.

But it turned out that underneath the surface coating of steel, Pittsburgh had a self-image that was impossible to erase. The citizens possessed a quirky, insular pride that enabled the place to survive the hardest of economic times. They believe that their hometown is, at once, uniquely gritty and uniquely beautiful. How they manage to hold both propositions at the same time is something that, not being a resident, I don’t fully understand. But I have seen it, and I have listened to it.

Much of Pittsburgh’s comeback over the past couple of decades can be traced to its bountiful array of universities and medical centers. But an important ingredient of the revival is the widely held belief of its citizens that it is a distinctive place, unlike any other city in the country. It isn’t entirely true. Buffalo is a lot like Pittsburgh. So is Cleveland, in some ways. What matters most, however, isn’t so much the reality as the feeling of specialness that the Steel City has been able to maintain in the absence of the factories that created its identity.

I may seem to be arguing that American cities are all the same. That is, of course, untrue. What does seem true to me is that they don’t differ in the ways that locals often insist they do. They differ in more permanent ways, some obvious and some fairly subtle. It’s probably worth mentioning a couple of them.

Geography is the most obvious and almost certainly the most important one. Pittsburgh will always be a place where steep hills rise from the confluence of three rivers. Chicago will always be a prairie on the edge of a lake. In trying to understand what makes a city the place it has become, geography will trump politics nearly every time. Much of the time, it will determine the character of local politics.

Demography may not be destiny, as demographers sometimes claim, but it lies at the root of urban identity and urban differences. Indianapolis is a town started and developed by white Anglo-Saxon Protestants, many of them Southerners. Milwaukee grew up as a magnet for ethnic Catholics from Europe, mostly Germany and Poland. The numbers have changed enormously in the last 150 years, but the 19th-century demographics still explain why these two cities are so different after all this time.

Can any city be described as a creature of its public policies? That’s an intriguing question; I would say probably not. But as with all of this speculation, there are bound to be exceptions. Houston decided a long time ago not to have zoning; it wanted its citizens to be able to build anything they wished just about anywhere they wished. Wide-open development not only gave Houston the look that it has today, but a distinctive self-image as well.

Which way does the arrow point? Did the absence of zoning create Houston, or did something fundamental about the city create the policy in the first place? That may be an impossible question to answer.

But what I draw from this whole quixotic pursuit of urban identity is this: The source of a city’s self-image may be hard to pinpoint. The image may or may not be entirely accurate. But cities that believe in their specialness are the ones that will do best in the long run.