I’ve really got to disagree with Kyle's statement that “the snake would never get large enough to look at it as food, and would have no reason to go into the bird's cage.” I think that snakes rely more on senses like smell/taste (and in the case of those with pits, heat), than they do on eyesight to initiate a feeding strike. And corn snakes are expert climbers which can scale trees to get at birds in their nests. And I’m sure most of us can recall instances where we offered snakes prey items that were just too big, where the snake might have attempted for an hour or more to consume it before it finally gave up and backed off.
Years ago, I was feeding a bunch of recently hatched Burmese pythons on the floor at the same time that I was thawing out a 5 pound chicken for their mother. One of the little hatchlings released its mouse and crawled over to the chicken, bit into part of a wing, and tried mightily to wrap its coils around that big bird, but succeeded mostly in constricting the wing.
As people have pointed out, a large parrot could easily kill the species of snakes you mentioned. But would the initial reaction of a seed and fruit eater be the same as that of a bird of prey or other snake-eating bird? I’d bet the advantage would go to an adult rat snake or king snake whose first inclination (assuming it had followed its sense of smell up to the cage in the first place) would be to strike, constrict and kill, then figure out afterwards it had snagged a too-large meal.
Also, although I know some people cage snakes and feeder animals like rodents in the same room, I wonder if doing so doesn’t make those snakes more prone to consider anything that moves as the food source they can smell so prominently nearby. And I can’t imagine that the constant presence of a potential predator would be all that great for the bird. But perhaps for both, sensory overload kicks in at some point and they stop being very aware of each other.
-Joan