@classmethod
def _write_inittab(cls, f, inittab, c_inittab, py_version):
    """ Write the Python version specific extension module inittab. """
    if py_version >= 196608:
        init_type = 'PyObject *'
        init_prefix = 'PyInit_'
    else:
        init_type = 'void '
        init_prefix = 'init'
    sorted_inittab = sorted(inittab)
    for name in sorted_inittab:
        base_name = name.split('.')[-1]
        f.write('extern "C" %s%s%s(void);\n' % (init_type, init_prefix,
            base_name))
    f.write('\nstatic struct _inittab %s[] = {\n' % c_inittab)
    for name in sorted_inittab:
        base_name = name.split('.')[-1]
        f.write('    {"%s", %s%s},\n' % (name, init_prefix, base_name))
    f.write('    {NULL, NULL}\n};\n')
