Type Signatures for extension modules (PEP draft)

I can find the following:

… but I’m not sure right now if that got any further.

1 Like

Does this idea require a PEP or I could just open a feature request issue?

I would worry about backward compatibility. While this shouldn’t break anything in the CPython itself, it introduces an incompatible change for external projects, which already use *.pyi files right now just for typing support. E.g. help() uses inspect’s signature, if available, to show signatures of callables, but we have also PEP 7, that instructs people to put “signature line” in docstring. Not sure how severe it is: we always can detect and exclude PEP 7 “signature” and prefer one from the inspect module, but…

This is a separate issue. And doesn’t help for external projects, unless AC will become public.

I think it’s fine to open the feature request, and if anything comes up that requires a big decision it can become a PEP at that point. (e.g. whether to use a .pyi instead of a .py, where to pull docstrings from, etc. - these might have good answers already, I’m not sure).

1 Like