A carpet python which swallowed a tennis ball has had its unusual dinner massaged out by a snake handler, saving it from sure starvation.

It is believed the 1.5-metre snake ate the ball within 24 hours of being found in a Belgian Gardens backyard in Townsville on Monday.

Snake handler Trish Prendergast said if it had not been rescued, it would have starved.

"[The tennis ball] may have broken down over ... 12 to 18 months," she said.

"But in the meantime, the snake would not have been able to eat any items."

Ms Prendergast, who is also a vet nurse, had never seen anything like it.

They used a thick coat of paraffin oil to lubricate the ball and help with regurgitation.

An X-ray confirmed the strange lump in the python was a tennis ball. ( Facebook: Townsville Snakehandler )

"Tennis balls are porous on the outside and not slippery like an egg," she said.

"So we didn't want it adhering or tearing the oesophagus as it came back up."

The delicate operation took 30 minutes before the ball was finally spat out.

"Snakes are basically one long great big spine with all ribcage," Ms Prendergast said.

"Too much pressure or force will break ribs, and damage organs.

"It was a little uncomfortable, it did receive some anti-inflammatories after we removed the ball just to help with any inflammation that might have happened."

The snake was found in a Belgian Gardens home on Monday. ( Facebook: Townsville Snakehandler )

The snake handlers and vets who worked on the snake hoped it had learnt its lesson.

They believe the ball smelt like prey, which is why it tried to eat it.

"It wouldn't eat it for the sake of it," Ms Prendergast said.

"I can't say I've ever had a tennis ball before, I have removed plastic chicken eggs and golf balls from snakes previously."

The python is now recovering and will be released into the wild next week.