Baseball: Rules for pitching lefty or righty

You can find some details in this thread from 2008, which was inspired by this story about Venditte facing a switch hitter. The two of them swapped sides over and over again. Quoting from there: