The short and long of the matter is that although your ball python technically may have been trying to eat you (say if you smelled like his or her dinner and he or she was pretty hungry), it’s physically impossible for a ball python to actually eat a human, even a human infant. The ideal prey for a ball python is a rodent that is just slightly fatter than the width of the largest part of the ball python’s body, meaning that a human is much too large for a ball python to eat. Ball pythons will not even bother trying to eat meals that are too large for them to swallow, and so the only reason a ball python would try to eat something of that size is if he or she mistakenly believed it was small enough to swallow. Once a ball python realizes its prey is too large to be swallowed, it will immediately give up on trying to eat it.
Since ball pythons have relatively poor vision, they depend on their heat sensors (located directly above their mouths; they look like a straight line of pink-coloured holes) and their sense of smell (which comes from licking the air) to determine whether or not something is edible. Ball pythons do have other reasons for biting a person, and so your ball python may not have been trying to eat you just because it bit you. Your ball python may have bitten you because it was stressed, on the defensive, or because it has a particularly viscous temperament (though if that had never been the case before, that is not likely to be the case now). If none of these explanations fits the experience you had, your ball python may have been trying to eat you, only because it wrongly thought that you were edible.
If you had recently cooked or handled meat, especially chicken or chicken stock, and didn’t thoroughly wash, your ball python may have had the impression that it could eat you, based on what you smelled like at the moment. If you played with rodents like gerbils, hamsters or mice, then tried to put your hand into a ball python’s enclosure, this is very likely the reason for their confusion, as rodents of all kinds smell like dinner to ball pythons.
If you have been bitten by a ball python who thinks that you are edible, and the ball python refuses to release its grip on your hand or finger, put the ball python’s body into some cold water and it should immediately release. These types of bites will likely cause bleeding, although they typically do not hurt as much as one would expect.