Add Python folding support