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

IDLE: calltips not properly formatted for functions without doc-strings #79822

Closed
taleinat opened this issue Jan 2, 2019 · 8 comments
Closed
Labels
3.7 (EOL) end of life 3.8 only security fixes easy topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@taleinat
Copy link
Contributor

taleinat commented Jan 2, 2019

BPO 35641
Nosy @terryjreedy, @taleinat, @mr-nfamous, @eamanu, @miss-islington
PRs
  • bpo-35641: IDLE - calltip not properly formatted if no docstring #11415
  • [3.7] bpo-35641: IDLE - format calltip properly when no docstring (GH-11415) #11420
  • bpo-35641: Move IDLE blurb to IDLE directory #11479
  • [3.7] bpo-35641: Move IDLE blurb to IDLE directory (GH-11479) #11480
  • 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 = <Date 2019-01-03.09:52:56.228>
    created_at = <Date 2019-01-02.16:43:39.946>
    labels = ['easy', '3.8', 'expert-IDLE', 'type-bug', '3.7']
    title = 'IDLE: calltips not properly formatted for functions without doc-strings'
    updated_at = <Date 2019-01-09.19:22:17.374>
    user = 'https://github.com/taleinat'

    bugs.python.org fields:

    activity = <Date 2019-01-09.19:22:17.374>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-01-03.09:52:56.228>
    closer = 'taleinat'
    components = ['IDLE']
    creation = <Date 2019-01-02.16:43:39.946>
    creator = 'taleinat'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35641
    keywords = ['patch', 'patch', 'patch', 'patch', 'easy']
    message_count = 8.0
    messages = ['332882', '332885', '332886', '332917', '332925', '332926', '333326', '333328']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'taleinat', 'bup', 'eamanu', 'miss-islington']
    pr_nums = ['11415', '11420', '11479', '11480']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35641'
    versions = ['Python 3.7', 'Python 3.8']

    @taleinat
    Copy link
    Contributor Author

    taleinat commented Jan 2, 2019

    IDLE usually wraps call-tips to 85 characters. However, for functions without a doc-string, this formatting is skipped. This is an issue for functions with long signatures, e.g. due to having many arguments or due to having default values with long repr-s.

    This appears to be caused by line 170 in Lib/idlelib/calltip.py being indented once too much. (see: https://github.com/python/cpython/blob/87e59ac11ee074b0dc1bc864c74fac0660b27f6e/Lib/idlelib/calltip.py)

    Thanks to Dan Snider for the original report in msg332881 on issue bpo-35196.

    Example:

    >>> def foo(s='a'*100):
    	pass
    
    >>> print(get_argspec(foo))
    (s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
    
    >>> def bar(s='a'*100):
    	"""doc-string"""
    	pass
    
    >>> print(get_argspec(bar))
    (s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaa')
    doc-string

    @taleinat taleinat added topic-IDLE 3.7 (EOL) end of life 3.8 only security fixes labels Jan 2, 2019
    @taleinat taleinat self-assigned this Jan 2, 2019
    @taleinat taleinat added the type-bug An unexpected behavior, bug, or error label Jan 2, 2019
    @taleinat
    Copy link
    Contributor Author

    taleinat commented Jan 2, 2019

    I'm marking this as easy.

    Whoever works on this should make sure to add a new test case for this bug.

    @taleinat taleinat added the easy label Jan 2, 2019
    @taleinat taleinat removed their assignment Jan 2, 2019
    @eamanu
    Copy link
    Mannequin

    eamanu mannequin commented Jan 2, 2019

    Hi Tal Einat!

    I would like to take this issue to be my first contribution :-)

    Thanks!

    @terryjreedy
    Copy link
    Member

    New changeset ab54b9a by Terry Jan Reedy (Emmanuel Arias) in branch 'master':
    bpo-35641: IDLE - format calltip properly when no docstring (GH-11415)
    ab54b9a

    @miss-islington
    Copy link
    Contributor

    New changeset 3c83cb7 by Miss Islington (bot) in branch '3.7':
    bpo-35641: IDLE - format calltip properly when no docstring (GH-11415)
    3c83cb7

    @taleinat
    Copy link
    Contributor Author

    taleinat commented Jan 3, 2019

    Thanks for the report, Dan!

    Thanks for the fix, Emmanuel!

    @taleinat taleinat closed this as completed Jan 3, 2019
    @terryjreedy
    Copy link
    Member

    New changeset ee65594 by Terry Jan Reedy in branch 'master':
    bpo-35641: Move IDLE blurb to IDLE directory (bpo-11479)
    ee65594

    @miss-islington
    Copy link
    Contributor

    New changeset 6f76ef8 by Miss Islington (bot) in branch '3.7':
    bpo-35641: Move IDLE blurb to IDLE directory (GH-11479)
    6f76ef8

    @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
    3.7 (EOL) end of life 3.8 only security fixes easy topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants