I was outraged when one of my neighbors recently presented my Manhattan co-op board with a petition to prohibit tobacco smoking in the building where I’ve lived happily for 20 years. When my husband and I borrowed money from both of our families to afford the purchase price of our apartment in 1996, I was a two-pack-a-day smoker. If the rules of the building had said no smoking back then, I wouldn’t even have looked at it.

I know firsthand smoking isn’t good for anyone’s health. But a landlord shouldn’t be able to force a tenant to quit doing something that’s perfectly legal, that they’ve been doing in the privacy of their own home, just because it’s self-destructive — especially when a lot of people can’t just quit at will.

My mother couldn’t force my dad to quit smoking his unfiltered Chesterfields until, in his 60s, he decided to stop for himself. The first cigarette I ever smoked, at 13, was stolen from the pack in his den. My grandfather and two aunts were big puffers. If the smoking gene is genetic, I inherited it.

By my 20s, “smoker” was part of my identity. On my first blind date with my husband, I asked, “Do you mind if I light up?” He gave me a light and whispered, “My first lover was a smoker. I associate smoking with sex” — I pictured him in bed with a bohemian belle. Over our six-year off-and-on courtship, he never once hounded me about my More menthol lights.

A week after we wed before a rabbi, judge, hundreds of relatives and friends, he said, “Now you have to quit cigarettes.” I thought he was joking. He wasn’t. I felt duped and betrayed. If he’d mentioned a smoking ban before we met, I wouldn’t even have looked at him. Smoke never bothered him until we were living under the same roof, he insisted. He loved me and wanted me to be healthy. I’d tried to stop, but couldn’t. I needed help.

Losing my 27-year fixation took five years, countless nicotine patches, daily exercise and a weekly addiction specialist who said I had the worst nicotine dependency he’d ever treated. A former smoker, he explained that nicotine is one of the most addictive substances around — up there with cocaine and heroin — and cessation methods varied for everyone. “Underlying every substance abuse problem I’ve seen is a deep depression that feels unbearable,” he said. “Addicts depend on substances, not people.” Perhaps that explained his odd mandate: My husband and I had to watch TV or a movie for an hour every night, his arm around me, without talking, which soothed my extreme withdrawal symptoms.

And it worked. I’ve been smoke-free for 15 years — my best, most productive decade-and-a-half. Avoiding anywhere people lit up, I became one of those anti-smoking zealots I used to hate.

So I understand the thought process behind the cigarette ban. The Centers for Disease Control and Prevention reports about 15 percent of Americans still smoke, a decline motivated by various campaigns to curb smoking and high tobacco costs. The U.S. Department of Housing and Urban Development maintains that its recently implemented smoking ban protects nonsmokers from secondhand smoke and reduces fire risks.

But changing rules that apply before someone moves in is different from dictating that owners can no longer smoke in a home they bought when cigarettes were allowed. If a co-op like mine kicks a smoker out, it might not even be possible to afford another place in the city. The cost of a small walk-up in my Greenwich Village neighborhood has skyrocketed to around a half-million dollars.

Some members of my co-op argue that secondhand smoke endangers others, and various buildings have been doing this for years. But wouldn’t it be unsafe for a teenager or a senior citizen to take to the streets at 2 a.m. for a smoking break? If I hadn’t quit smoking and I was up working late, should I be forced to puff outside my own building in the rain or snow? Drunken drivers killed more than 10,000 people last year, but no one is proposing a ban on alcohol, right?

So what’s the fair way to accommodate antismoking shareholders while showing empathy for our neighbors who smoke and can’t quit? It would be reasonable to restrict smoking on our shared rooftop and courtyard while allowing it inside individual residences. More fair than a vote to ban smoking for everyone would be a grandfather clause stating that a non-smoking rule would only apply to future tenants. A generous solution would be to offer building-sponsored gym memberships, counseling and cessation meetings to help people quit.

As a former smoker, I go out of my way to avoid secondhand smoke. But I also know that most of us have at least one bad habit, whether it’s smoking, drinking, overeating, gambling, compulsive shopping or taking too many pain pills. I’m not willing to ostracize my neighbors for an addiction I once shared. I remember how hard it was to kick. What’s called for is compassion, not shame or threats of eviction.