From selfies and hashtags to Game Of Thrones references, comedian Jack Whitehall is keen to keep things up-to-the-minute on his school-based sitcom Bad Education.

But a cabinet reshuffle this summer, which saw controversial education secretary Michael Gove ousted from his role, gave Whitehall and his co-writer Freddy Syborn a script headache.

"I'll tell you what's annoying," the star says with a sigh, the day after Gove's move to chief whip was announced.

"Me and Freddy wrote a load of stuff - we were like, 'This series, especially because of what's been happening for the last year, we're going to try and do some nice stuff that kind of has a pop at Michael Gove'. So there are all these Michael Gove gags, and now they move him.

"Just keep him there for six months more until the show goes out. Then, by all means get rid of him, and it will look like maybe we've played a part! So selfish."

We're on the set of the hit comedy, where a framed photograph of Gove hangs in the headmaster's office and posters of 'Hot Babes Through The Ages' (ranging from Cleopatra to Pamela Anderson) and 'Role Models' (Liam Gallagher and Amy Winehouse) adorn the walls.

The light-hearted mood is tinged with some sadness, however, as Whitehall admits series three will most likely be the final instalment.

"It ends in a moment of it feeling like it's the last one. And when we set out to write it, it was meant to be the last one," the 26-year-old admits.

"It's so enjoyable to do that you suddenly think, 'Oh God, maybe it would be nice to come back and do more'. But I think this will probably be the last series."

Bad Education's state school set-up is somewhat different to London-born Whitehall's own school days, which included a stint at the Duchess of Cambridge's alma mater, Marlborough College in Wiltshire.

But the well-spoken funny man - who also played posh JP in Channel 4's university sitcom Fresh Meat - was able to draw inspiration from his former teachers when it came to playing "man child" Alfie.

"There were a few tragic ones," he says with a laugh, looking not unlike a student in a checked shirt and trainers today.

"I've been back to my school a few times and you see those teachers that you thought were quite cool when you were there because they were all being like mates, and they're tragic now that you're slightly older.

"There's no one specifically that he's been based on," Whitehall hastens to add. "Legally."

After three series working with his young cast, he confesses that watching the final scenes back left him feeling emotional.

"Obviously I didn't cry, because I'm a bloke, and blokes don't cry," he says, straight-faced.

"No, I cry all the time. So I was welling up a bit. But I'm quite highly-strung emotionally; at the end of a series of A League Of Their Own [the Sky1 sports show on which he makes regular appearances] I cry, because I know I wont see [co-star] Jamie Redknapp's beautiful face for another eight months."

Looking at Whitehall's CV - sell-out tours, high profile fans (sporting stars Mo Farah and Sir Chris Hoy are both said to enjoy Bad Education) and more than 2.5 million Twitter followers - it's hard to believe he has only been on the planet, let alone the comedy circuit, for a quarter of a century.

The son of theatrical agent Michael, who stars alongside him in the BBC Three talkshow Backchat, and actress Hilary, Whitehall studied history of art at the University of Manchester before deciding to pack it in for a career in comedy.

"Dad said, 'Don't be an actor, because you'll just be out of work', which was nice and encouraging. And I've defied him. I think he wanted me to be an artist."

While performing stand-up around the country, Whitehall landed a presenting gig on Big Brother's Big Mouth aged 19, and went on to appear on panel shows including Mock The Week and Have I Got News For You.

His acting debut was in Fresh Meat (where he met his girlfriend, actress Gemma Chan), followed by Bad Education, which broke BBC Three's record for the highest-rated first episode of a comedy.

The new series sees Alfie living with his colleague and girlfriend Miss Gulliver (Him And Her's Sarah Solemani) as his dad Martin (played by Harry Enfield, one of Whitehall's comedy heroes) is appointed deputy head.

"I think by the end, Alfie's a more mature presence than he was at the beginning of the series," Whitehall notes.

"But any step forward is a tentative one. He's still a bit of a feckless idiot. He thinks he's a grown up, but he's not really."

Has Whitehall grown up himself since series one?

"Noooo. I probably haven't matured. The kids have, sort of. They're certainly taller and more pubescent, but in terms of their characters, they're still pretty immature.

"It's just generally a pretty immature set; Harry [Enfield] is pretty immature as well. So there's not a great level of maturity."

If he hadn't found his niche in comedy, Whitehall reckons he could have followed his character's career route - although he "wouldn't be that dissimilar to Alfie - quite tragic, trying to be [the pupils'] friend".

Turning serious for a moment, he adds: "It is a job that would be an attractive prospect I think, to go and teach. I have a great deal of admiration for teachers in this country and people that can go and do it.

"I don't know whether I'd be any good, but it's certainly a profession that I admire."

EXTRA TIME - COMEDIANS TURNED ACTORS

* Ricky Gervais - The funny man's big TV debut came as part of Channel 4's late Nineties Comedy Lab series. He went on to play The Office's infamous David Brent and the title role in Channel 4's retirement home sitcom, Derek.

* Billy Connolly - Scottish stand-up Connolly was nominated for a Bafta for his performance alongside Judi Dench in 1997's Mrs Brown. He also played a retired musician in 2012 comedy film Quartet.

* Eddie Izzard - Cross-dressing comic Izzard has appeared on the silver screen in Ocean's Twelve, The Chronicles Of Narnia and Velvet Goldmine. He's also acted on TV in The Simpsons, voicing the Queen.

* Russell Brand - Hollywood came calling for Brand in 2008, when he starred as a rock musician in Forgetting Sarah Marshall. He's also shown his acting chops in big screen comedies Get Him To The Greek and Arthur, the 2011 remake of the Dudley Moore hit.

* Alan Davies - Essex-born Davies earned his crust as a stand-up before appearing on TV. He plays the title role in BBC crime drama Jonathan Creek, and also starred in the 2008 teen comedy Angus, Thongs And Perfect Snogging.

Bad Education returns to BBC Three on Tuesday, September 16