Generate C++ lookup functions with Python