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

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

Closed
alsuren mannequin opened this issue Dec 24, 2008 · 2 comments
Closed

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

alsuren mannequin opened this issue Dec 24, 2008 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@alsuren
Copy link
Mannequin

alsuren mannequin commented Dec 24, 2008

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

    @alsuren
    Copy link
    Mannequin Author

    alsuren mannequin commented Dec 24, 2008

    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.

    @alsuren alsuren mannequin assigned birkenfeld Dec 24, 2008
    @alsuren alsuren mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Dec 24, 2008
    @birkenfeld
    Copy link
    Member

    Thanks for the patch!

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

    @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
    docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant