Skip to content

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

Closed

Description

@taleinat
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']

    Activity

    1. taleinat commented on Jan 2, 2019

      @taleinat
      ContributorAuthor

      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
    2. self-assigned this
      on Jan 2, 2019
    3. taleinat commented on Jan 2, 2019

      @taleinat
      ContributorAuthor

      I'm marking this as easy.

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

    4. removed their assignment
      on Jan 2, 2019
    5. eamanu commented on Jan 2, 2019

      eamanumannequin
      Mannequin

      Hi Tal Einat!

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

      Thanks!

    6. terryjreedy commented on Jan 3, 2019

      @terryjreedy
      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

    7. miss-islington commented on Jan 3, 2019

      @miss-islington
      Contributor

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

    8. taleinat commented on Jan 3, 2019

      @taleinat
      ContributorAuthor

      Thanks for the report, Dan!

      Thanks for the fix, Emmanuel!

    9. terryjreedy commented on Jan 9, 2019

      @terryjreedy
      Member

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

    10. miss-islington commented on Jan 9, 2019

      @miss-islington
      Contributor

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

    11. 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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions