如何扩展Python并制作C包?

不久前,我在C应用程序中嵌入并扩展了Python 2.7。在火车上晚些时候,我将其带到Python 3,并且模块注册的许多初始化对我来说也发生了变化。

Before I used PyModule_Create to create the module and added the members afterwards, even sub-modules so I could execute:

from foo.bar import bas

I added/appended the 'top-level' module to PyEval_GetBuiltins(), which might have been wrong in Py 2, but it worked. Now in Py 3 I receive this exception on the code above:

Traceback (most recent call last):
  File "foo.py", line 1, in <module>
ModuleNotFoundError: No module named 'foo.bar'; 'foo' is not a package

Looking up the docs, I found now an example with PyImport_ExtendInittab. I have two questions regarding this:

1) What is Inittab supposed to mean? The doc says what it means, but this naming is slighly irritating. What is an Inittab? Shouldn't it be called PyImport_ExtendBuiltins, that I would understand.

2) I can only find examples where plain modules get added. Is creating a package with sub-modules possible with PyImport_ExtendInittab too?

非常感谢!