Initial Python port.