Skip to content

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

Open

Description

@serhiy-storchaka
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 = []

Activity

  1. serhiy-storchaka commented on Jan 2, 2013

    @serhiy-storchaka
    MemberAuthor

    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?

  2. meadori commented on Jan 3, 2013

    @meadori
    Member

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

  3. serhiy-storchaka commented on Jan 3, 2013

    @serhiy-storchaka
    MemberAuthor

    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.

  4. merwok commented on Jun 29, 2021

    @merwok
    Member

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

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions