python generate hook support.