Should this just be `if s.endswith('.pyx') or s.endswith('.c')` to avoid code duplication?