re-use is_python(); don't duplicate its logic