It’s the most cynical political game in a cynical town, calculated to deprive New York voters of what little democracy they’re allowed to participate in.

Veteran Assemblyman Herman “Denny” Farrell reportedly plans to be the latest machine politician to step down at just the right time to prevent voters from picking his successor.

Leave office before your term expires, but after the filing date for the Democratic primary, and you’ve assured that county party leaders, not voters, get to pick the next candidate. And that candidate almost always is the one the outgoing legislator wants.

We’ve seen it all before, but this year in particular has produced a bumper crop of similar travesties.

State Sen. Daniel Squadron (D-Queens) last week announced he was quitting because of his frustration with Democratic divisions in Albany.

Fair enough. Yet somehow his frustration kicked in only after it was too late for anyone else to qualify for a special election.

Last month, City Councilman David Greenfield (D-B’klyn) announced his resignation to head the scandal-scarred Metropolitan Council on Jewish Poverty — also too late for any other candidates. He then tapped an ally (who was already running in a different district!) to succeed him.

Just two years ago, then-Bronx DA Robert Johnson abruptly resigned in a squalid deal engineered by current Assembly Speaker Carl Heastie that gave Johnson a state Supreme Court judgeship and replaced him with the machine’s hand-picked choice, Darcel Clark.

And people wonder why New Yorkers are so cynical. The city’s heavy Democratic tilt has deprived most general elections of any meaning, and now the bosses are increasingly shutting voters out of primaries, too.

Greenfield, for one, makes no apologies for gaming the system. If you don’t like the rules, he says, change them.

Instead of pushing arcane fixes to the campaign-finance laws, self-proclaimed “reformers” ought to take up that challenge — or stop pretending they really want to clean up politics.