Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override a function signature for pydoc with a docstring #61046

Open
serhiy-storchaka opened this issue Jan 2, 2013 · 4 comments
Open
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 16842
Nosy @birkenfeld, @merwok, @meadori, @serhiy-storchaka

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 = None
closed_at = None
created_at = <Date 2013-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 = <Date 2021-06-29.13:47:58.655>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2021-06-29.13:47:58.655>
actor = 'eric.araujo'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2013-01-02.20:08:25.849>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 16842
keywords = []
message_count = 4.0
messages = ['178846', '178880', '178930', '396727']
nosy_count = 4.0
nosy_names = ['georg.brandl', 'eric.araujo', 'meador.inge', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue16842'
versions = []

@serhiy-storchaka
Copy link
Member Author

Just a quote of Georg Brandl's msg178519:

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?

@serhiy-storchaka serhiy-storchaka added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Jan 2, 2013
@meadori
Copy link
Member

meadori commented Jan 3, 2013

Serhiy, did you mean to mark this as "patch review"? I don't see a patch.

@serhiy-storchaka
Copy link
Member Author

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
Copy link
Member

merwok commented Jun 29, 2021

This proposal pre-dates signature objects; I wonder if they can be used to handle the use cases here.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants