The two funniest moments in the history of Monty Python were also two of the darkest, and both were thanks to Graham Chapman’s death.

Chapman, who played King Arthur in the film Monty Python and the Holy Grail, and Brian in Monty Python’s Life of Brian, died of cancer in 1989, aged 48.

His friends organised a memorial service in London and John Cleese gave the lead oration.

“The author of the Parrot Sketch is no more,” he intoned, solemnly, to respectful quiet… “Good riddance to the freeloading bastard, I hope he fries.”

“Anything for him but mindless good taste,” Cleese explained. Cleese then described how Chapman had appeared at his shoulder the night before, as Cleese was writing his oration.

“If this service is really for me,” Chapman had told him, “I want you to become the first person ever at a British memorial service to say ‘fuck’.”

The first – but not the last. Eric Idle concluded the service by leading a rendition of Always Look on the Bright Side of Life. As it finished, he leaned into the microphone.

“I’d just like to be the last person at this meeting to say ‘fuck’,” he said. (Footage of this is on YouTube, at http://bit.ly/PEqg.)

Years of speculation of a Monty Python reunion ended with Chapman’s death. As Idle said (playing on George Harrison’s famous line about a Beatles reunion after John Lennon’s death), “We would only do a reunion if Chapman came back from the dead.

“So we’re negotiating with his agent,” he added.

But there was a reunion of sorts in 1998, at a comedy festival in Aspen in the US. The five surviving members of Month Python came on stage with an urn containing Chapman’s ashes. During the interview, Terry Gilliam knocked it over, sending dust everywhere, and the others scrambled to hoover it up. After it had been cleaned up, Michael Palin started chatting with the urn, which rattled in answer.

The success of that sketch led to talk amongst the group of a possible stage reunion. Eric Idle, who had written most of the Python songs (including the Bright Side of Life), was keen to do a Monty Python musical, but the others cooled on the idea. Instead, Idle put together his own show and took it on the road; aptly, it was called the Eric Idle Exploits Monty Python Tour.

Then, in 2002, most the surviving Pythons met again, at another memorial – this time a concert for George Harrison (who had funded their Life of Brian film, and become close friends with Idle), and this rekindled Idle’s desire to do the musical.

With composer John Du Prez (who had played the trumpet on the original Bright Side of Life recording), he started to work on stage version of Monty Python and the Holy Grail, their spoof on the legend of King Arthur, memorable, amongst many moments, for being perhaps the only film ever to feature a killer rabbit.

But, having being burnt before, Idle was cagey, and smart. He didn’t tell his former comrades anything about it until it was well developed, and then sent them studio recordings of some of his new songs. He had decided to call the show Spamalot, from a nonsense line in the movie, “we eat ham, and jam and Spam a lot,” and described it officially as being “loving ripped off” from the film.

“The hardest thing to do was persuade them it could go well,” Idle said, later. “They were very defensive of their material, understandably.”

But the key to persuading them wasn’t his ideas for their material – it was his own, new material, particularly a song.

That song may have an utterly Pythonesque title – The Song That Goes Like This – but in form it is precisely what Broadway audiences warm to: a pastiche of a rousing Andrew Lloyd Webber number. What the Pythons saw was that Idle was not content to merely rehash well-worn material, but that he was prepared to have a good dig at the conventions of the form through which he was rehashing it.

Spamalot would not merely be Monty Python on stage; it would be a Monty Python musical that would excel as a musical, even while it mocked the genre.

By the time it opened, Spamalot was already a success: it had broken records for advance booking. On opening night, on St Patrick’s Day in 2005, all the Pythons were there, and both they and the critics gave it their seal of approval. Ultimately, it ran on Broadway for four years, playing over 1500 performances to more than two million people. It won three Tony awards, including best director (for the legendary film director Mike Nichols) and best musical. As the Python Terry Jones said, later, the original television series and films had “never had a mass audience. So this is the first time Monty Python has broken through to reach the kind of popular audience turning up for Spamalot.”

The sharp edge of Monty Python is clearly blunted in Spamalot – but this may be precisely why it is so successful. Eric Idle’s formula for good theatre is simple: a show where you can “laugh, have a song, laugh, have a song,” he has said. In Spamalot, the audience gets to laugh at some inspired silliness, enjoy some well-loved, well-worn songs, and then laugh again at new songs, perceptive parodies of the bombastic Broadway genre.

In London, Spamalot received a more guarded reception, and some of the reviews were decidedly sniffy. Yet even the Guardian’s Michael Billington, who quickly tired of it, noted that the audience around him “greets each Pythonesque gag like an old friend.” Some of the other leading critics were clearly amongst those old friends.

“It’s a wonderful night, and I fart in the general direction of anyone who says otherwise”, wrote Charles Spencer in the Daily Telegraph. In the Independent, Paul Taylor wrote that it left him “high and weak with laughter.”

Eric Idle still gets accused of exploiting the Monty Python legacy, but he deals with that with equanimity.

“I’ve learnt that you can’t escape these things,” he has said. “Some people run like crazy and hide and get embarrassed. I’ve learned that you might as well embrace it. I’d rather perform Python than talk about it.”

No doubt Spamalot will disappoint (or even offend) some Python purists. But Idle has clearly opened their legacy up to a new generation of audience, as well as providing older ones with some nostalgic entertainment. There are worse crimes in theatre.

Spamalot is at the Grand Canal Theatre in Dublin from May 9 to 14. www.grandcanaltheatre.ie

Best moments from the Monty Python films

Monty Python and the Holy Grail

The French taunting scene: “I fart in your general direction. Your mother was a hamster and your father smelt of elderberries… Now go away or I shall taunt you a second time.” http://bit.ly/239h8

The Black Knight (missing both his arms): “It’s just a flesh wound.” http://bit.ly/uDT5O

The Knights of the Round Table song… in Lego http://bit.ly/1HG8cY

Monty Python’s Life of Brian

Brian: “You’re ALL individuals!
The Crowd: “Yes! We’re all individuals!” http://bit.ly/Sb0AX

Brian: “Excuse me. Are you the Judean People’s Front?”
Reg: “Fuck off! We’re the People’s Front of Judea.” http://bit.ly/jhkV3

Always Look on the Bright Side of Life http://bit.ly/9GEfyI