You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to override a function signature for pydoc with a docstring #61046
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2013-01-02.20:08:25.849>labels= ['interpreter-core', 'type-feature']
title='Allow to override a function signature for pydoc with a docstring'updated_at=<Date2021-06-29.13:47:58.655>user='https://github.com/serhiy-storchaka'
A simple, minimal-invasive solution would be to allow a signature for documentation purposes as the first line of the docstrings.
pydoc could recognize this (if docstring.startswith(func.__name__ + '(') or something like that), and display the given signature instead of the introspected one.
I see only one obstacle. Some functions (like dict.update()) needs several signatures. How detect and format them?
Activity
serhiy-storchaka commentedon Jan 2, 2013
Just a quote of Georg Brandl's msg178519:
I see only one obstacle. Some functions (like dict.update()) needs several signatures. How detect and format them?
meadori commentedon Jan 3, 2013
Serhiy, did you mean to mark this as "patch review"? I don't see a patch.
serhiy-storchaka commentedon Jan 3, 2013
Sorry, I mixed up the issues. For this issue I have not a patch yet. I wait for some suggestions and decisions first.
See also related bpo-16638.
merwok commentedon Jun 29, 2021
This proposal pre-dates signature objects; I wonder if they can be used to handle the use cases here.