[Python-Dev] Sharing docstrings between the Python and C implementations of a module
larry at hastings.org
Tue Apr 16 01:21:40 CEST 2013
On 04/15/2013 09:31 AM, Eli Bendersky wrote:
> Would it make sense to think about adding this in the scope of the
> argument clinic work, or is it too unrelated? This seems like a
> commonly needed thing for large parts of the stdlib (where the C
> accelerator overrides Python code).
From my perspective, the C accelerator doesn't override the Python
code; the Python code is in charge, and elects to call the C accelerator.
To answer your question, Clinic could help but I think it'd kind of
suck. We'd have to use Clinic to preprocess the .py file and copy the
docstring there, which would mean slurping in the C file. Clumsy but
workable. We can talk about it once I finish the revised
implementation, which should make processes like this much easier.
More information about the Python-Dev