[Python-Dev] Expression optimizations