complete compatibility with original pattern2.6 library on Python2