Call it sexist if you like but a type of threatened parrot has started favouring male offspring at the expense of female chicks as its environment changes.
Researchers at the Australian National University have discovered the swift parrot's breeding habits change much more quickly than previously thought when a predator intrudes on their area.
They produce more males to try to bump up the population.
The parrots have a new predator, a type of possum known as the sugar glider (it likes eating sugar). The sweet-toothed animal attacks female swift parrots in their nests. Because the mother parrots are sitting on eggs, they are easy prey.
But the parrot is no fool. It's adapted its breeding habits. Its "thinking" is that fewer females means males will have to compete harder for a mate. The answer is to produce more males so more have a chance of mating and so producing the next generation.
"Female swift parrots can determine the sex of their offspring, and they are favouring boys over girls as they face diminished survival prospects in the wild," Professor Rob Heinsohn said.
"Instead of producing extra daughters to make up for a shortage of adult females they make sure their sons hatch first so they get more food and become more competitive in a tight mating market."
Prof Heinsohn says the parrot now tends to lay two male eggs first and then a female one. The chicks which hatch first have a much better chance of survival. They get more food. Prof Heinsohn calls it "the silver spoon effect".
Nobody knows how some animals get to determine the sex of their offspring but some can. "It's a great mystery. Whoever finds out will get a Nobel prize," Prof Heinsohn said.
There are other animals whose gender balance is affected by the environment, he said. Because of global warming, the number of males of a type of turtle is falling and that's having a catastrophic effect on the population. The same with crocodiles.
This particular type of turtle lays eggs in the sand but female eggs hatch better in warm sand and male eggs better in cool sand. More warmer sand means fewer males.
There are also a few species (including humans) which kill their offspring if they are the "wrong" sex.
He says the eclectus parrot lays female eggs first because the laying season is limited by monsoons.
The first chicks to hatch have a better chance of survival.
Caution is in order if humans try to intervene in the weird ways of nature and gender.
Prof Heinsohn says an attempt was made to try to save the kakapo (yet another type of parrot) from extinction in New Zealand. It's the world's biggest parrot and looks, he said, like a "huge, cuddly stuffed toy".
With its survival threatened by new predators, particularly stoats and weasels, the remaining birds were moved to an island and fed.
But they were over-fed and this abundance of food made the females "think" life was grand - and that "persuaded" them to produce more males.
The well-meaning human helpers have now cut the kakapo's food so the parrot's production of males and females is back in balance.
Our journalists work hard to provide local, up-to-date news to the community. This is how you can continue to access our trusted content: