Skip to content

[patch] Let users do help('@') and so on for confusing syntax constructs. #48989

Closed

Description

@alsuren
mannequin
BPO 4739
Nosy @birkenfeld, @giampaolo
Files
  • add_symbol_help.diff: patch against pydoc.py from python 2.5.2-0ubuntu1
  • 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 = 'https://github.com/birkenfeld'
    closed_at = <Date 2008-12-27.18:20:43.864>
    created_at = <Date 2008-12-24.17:37:45.327>
    labels = ['type-feature', 'docs']
    title = "[patch] Let users do help('@') and so on for confusing syntax constructs."
    updated_at = <Date 2008-12-27.18:20:43.863>
    user = 'https://bugs.python.org/alsuren'

    bugs.python.org fields:

    activity = <Date 2008-12-27.18:20:43.863>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-12-27.18:20:43.864>
    closer = 'georg.brandl'
    components = ['Documentation']
    creation = <Date 2008-12-24.17:37:45.327>
    creator = 'alsuren'
    dependencies = []
    files = ['12441']
    hgrepos = []
    issue_num = 4739
    keywords = ['patch']
    message_count = 2.0
    messages = ['78267', '78375']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'giampaolo.rodola', 'alsuren']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue4739'
    versions = ['Python 2.5']

    Activity

    1. alsuren commented on Dec 24, 2008

      alsurenmannequin
      MannequinAuthor

      When I first came across decorators (about a year ago?), they confused
      the hell out of me, and the syntax is completely google-proof, so I
      ended up having to ask on irc.

      One of the things that I tried was help('@') but that didn't work
      either. This patch is to make that work, and also a lot of other
      google-proof syntax constructs.

      Notes on the patch
      ==================

      I've tried to do it with as few changes/duplications as possible, but my
      style is quite different from the rest of the module. I hereby donate my
      code to whoever wants to commit it. Do what you want with it, and clean
      it up however you want. I'm doing it for the n00bs.

      The patch is against pydoc.py from python 2.5.2-0ubuntu1. If you want me
      to create a patch against another version of python, send me an email.
      Otherwise, apply it by hand: I've tried to make as few changes as
      possible, so it shouldn't be too tricky.

      Notes on other versions of Python
      =================================
      Python 3000 (and maybe 2.6? I've not checked) has the note:
      # CAUTION: if you change one of these dictionaries, be sure to adapt the
      # list of needed labels in
      Doc/tools/sphinxext/pyspecific.py and
      # regenerate the pydoc_topics.py file by running
      # make pydoc-topics
      # in Doc/ and copying the output file into the Lib/ directory.
      but all I'm doing is adding aliases, so you shouldn't need to rebuild
      the docs just to get help() working. Note that I've not actually tested
      this though.

      To test, I did:
      python -c 'import pydoc ; help(":=")' | grep 'no Python documentation
      found for .*'
      which should print:
      no Python documentation found for ':='
      and:
      python -c 'import pydoc ; [help(k) for k in pydoc.help.symbols]' | grep
      -c 'no Python documentation found for .*'
      which should print nothing.

    2. added
      docs
      type-feature
      on Dec 24, 2008
    3. birkenfeld commented on Dec 27, 2008

      @birkenfeld
      Member

      Thanks for the patch!

      Applied with minor edits to the trunk as r67953. I will backport to the
      2.6 branch as well.

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

    Labels

    docstype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions