major fix in Pattern in Python API