SEEN from afar, the behaviour of America's government over the past month or so has been decidedly odd. Finance ministers visiting the IMF and the World Bank on October 11th, some of them from countries America has helped rescue in the past, seemed bemused by what was going on in Washington. China's government, which holds the idea that countries ought not to intervene in each others" affairs to be self-evident, criticised America repeatedly for failing to raise the debt ceiling, the legal limit on government borrowing, in a timely manner. Zhu Guangyao, the deputy finance minister, suggested that the Tea Party was to blame, an intervention that drew the somewhat Chinese response to "stay out of our politics." Unfortunately, while behaving erratically from time to time can be endearing, doing so repeatedly is a sign of illness. Though a deal to raise the debt ceiling was done at the last minute, America will have to go through this all over again in the new year. Crisis was averted thanks to dealmaking in the Senate. Republicans have extracted a small concession from the administration: officials must now check the incomes of people receiving subsidised health insurance more thoroughly. In exchange, the government has been funded until January 15th and the debt ceiling has been raised until February 7th. The parties have also agreed to come together and write a budget plan for the next ten years by December 13th, a stipulation which shows a touching belief that two sides unable to agree over small things will suddenly discover harmony when presented with something big and difficult. One reason the country keeps finding itself in this position is that legislators have adopted a style of government by torture. When the two sides failed to strike a budget deal in 2011 they devised a punishment that would hurt each of them if negotiations were to fail again. When they duly failed, the "sequester" - a package of spending cuts to things cherished by both parties - took effect. As a result defence spending is projected to be reduced by 10% this year, while federal funding for research and development will fall by 5%. In September, faced with a similar choice between agreeing on a budget deal or stopping discretionary spending (the government shutdown), the parties opted for a shutdown. Among other things, this meant that most staff at the Centres for Disease Control and Prevention, which tracks the spread of infectious diseases, were sent home for nearly three weeks. Once again, accepting something previously considered appalling proved preferable to compromise. In the case of the debt ceiling, the threat of torture worked. Since May, when government borrowing reached $16.7 trillion, the Treasury Department has been using accounting tricks such as delaying contributions to the retirement funds of federal workers to pay the government's bills. The Treasury estimated that it would run out of room to do this on October 17th. In the run- up to that deadline, bond-fund managers began to pay unusual attention to the inner workings of the Treasury's payments system, something which few people had previously thought it necessary to understand. Fitch, a ratings agency, put America's sovereign debt on negative watch, suggesting that it is contemplating following Standard & Poor's in downgrading America's rating. Yet even with the risk of default approaching, a large number of Republican legislators chose ideological purity over the avoidance of a crisis. Ordinarily both the House and the Senate pass bills, which are then reconciled in conference and signed by the president. In this case the House, where there is a large group of Republicans with a hatred of compromise, elected not to put forward a bill rather than break the convention that only legislation with support from a majority of the majority can come to the floor. After the House had sidelined itself, a deal was struck in the Senate between Harry Reid, the leader of the Democratic majority, and Mitch McConnell, the leader of the Republican minority. This came after separate talks between a group of moderate, mostly female, senators from northerly states, suggesting that a willingness to compromise correlates with possession of two X-chromosomes and a pair of snowshoes. The Republican-controlled House then passed the Senate's bill with a majority of Democratic votes and a minority of Republican ones. In political terms this spat has been bad for Republicans. An NBC/Wall Street Journal poll found a 22-point difference between those inclined to blame Republicans in Congress for their handling of budget negotiations and those blaming the president. This helps to explain why the Republicans moved so far from their original demands, which at various points included the defunding of Obamacare, the repeal of parts of the Dodd-Frank Act, which regulates financial services, and changes to the Environmental Protection Agency's regulations on carbon emissions. The Economist's YouGov poll shows a smaller, though still significant, gap in the president's favour. Neither of these numbers is a great endorsement of either side. A Pew Centre Poll found that a record number of registered voters wanted most of Congress sacked in the next electoral cycle. Yet if the Democrats have won this round, it is a victory that looks a lot like a defeat. The party has not given up much but it has not gained anything either, unless you take the view that opening the government and avoiding default is a concession to Democrats. Spending will remain at levels set by the sequester. Discretionary spending will remain at levels last seen during the presidency of Eisenhower. Seen from the air, the budget fight looks a lot like trench warfare, a tactic refined in France in 1914 but pioneered by American generals during the civil war. After an exhausting fight the frontier may have shifted a bit, but not enough that anyone would notice or that either side would feel inclined to sue for a lasting peace.