A costal carpet python is to be operated upon, to remove the two golf balls that he swallowed after mistaking them for chicken eggs

A resident from Kyogle in northern New South Wales had put the balls in his chicken coop to encourage his hens to lay.

Representational picture

But 'Callaway' - named after the famous brand of golf balls - thought the 'eggs' were the real thing and duly swallowed them.

The snake was brought to Currumbin Wildlife Sanctuary's animal hospital where he will undergo surgery on Tuesday.

"If we didn't get the golf balls out, Callaway would eventually starve to death," the Courier Mail quoted vet Andrew Hill as saying.

Dr Hill said Callaway should make a full recovery and be back in the wild soon.